Add first steps tutorial and termynal plugin

Description
Adding a first tutorial and a plugin to add animation to the bash scripts
Documentation

[ ] Bug fix (non-breaking change which fixes an issue)
[x] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
[ ] This change requires a documentation update

How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Checklist:

[x] My code follows the style guidelines of this project
[x] I have performed a self-review of my own code
[ ] I have commented my code, particularly in hard-to-understand areas
[x] I have made corresponding changes to the documentation
[ ] I have added tests that prove my fix is effective or that my feature works
[x] New and existing unit tests pass locally with my changes
[x] I have checked my code and corrected any misspellings

Looks good overall, but I'd like to show a good example of the result set from the index query.


fix response before request handling

This is a regression from 2e53d0. During situations where we perform a
continuation, filters do not expect to get further request data if they
either finish the response or reset. In this case, we must drop further
request data. This still allows bidirectional streaming to take place.
As part of this investigation I noticed a potential issue in nghttp2
where we don't always send a complete response if we reset after sending
the response (for example a redirect with body or a 404). I filed an issue
with nghttp2 and will follow up with this separately.

:+1:


The grep option may cause confusion

For new users of mocha, they might not know what the grep option is for. For people familiar with jasmine, they might think that the value *-test pertains the the filename suffix, e.g. thing-test.js, since Jasmine by default looks for files like thing.spec.js.
The README should mention that the grep option filters the tests and only runs those that match the pattern. It does not run those that don't.
Or else, the README needs to include a basic unit test that works with the configuration. Because most likely, the configuration (as is) won't run the tests that new users write.

so if I can declare in my Gruntfile.js:
simplemocha: {
    all: { src: 'test/*-node.js' }
}

why would I need grep?

@ekkis, the grep option does not filter files, but rather the tests themselves. It's a Mocha option. See Mocha's CLI options:
-g, --grep <pattern>                    only run tests matching <pattern>

It says "tests", which apparently means the description string of the describe() blocks

This repository should really remove the grep option from the examples. It will only confuse people and cause their setups to not run any tests! Because who writes describe() blocks containing the string -test in the test description?
Since the grep will match none of their describe blocks, then none of their tests will run. So grep should be removed from the examples.

ah.  that explains why I get 0 passing (0ms).  LoL.  thanks guys

You're right— this is pretty confusing! Thank you for opening the issue and I'm sorry for the confusion. I've clarified in the docs that it merely passes the options to new Mocha


Hey this might actually work

Adds two-factor authentication via mobile authenticator app (tested with Google Authenticator).
Lotta stuff in this, and it's login code, so I'm leaving it here for review.

I wonder, is this testable? It'd be nice to have tests on something this big.

Um. Depends on your definition of "possible"... I mean, if you want to emulate an Android device and screen-scrape and run optical character recognition on screenshots, yeah it's testable ;)

Can't go that deep, I was thinking more something that just checks login flow and spoofs whatever codes are necessary.

We can have regular tests, of course - "does this action add a code to this model". Now I think about it, it actually might be possible to test the 2FA element, too, since we can just use the same library to generate the necessary 2FA codes.

Welp, why not try it.


Update Snakemake Documentation

Based on #48 and #51, Snakemake-maintenance.md is very outdated.

Okay, I think I've left this in a good state: @acevedol @ericawood would you mind giving it a read and letting me know if anything is particularly confusing?

This is done, thank you @kvarforl!


How to calculate UCF101's top1 video level accuracy

hello，I calculated UCF101's top1 video level accuracy by running the following command
Calculate top-5 class probabilities of each video using a trained model (~/data/results/save_200.pth.)
Note that inference_batch_size should be small because actual batch size is calculated by inference_batch_size * (n_video_frames / inference_stride).

python main.py --root_path ~/data --video_path kinetics_videos/jpg --annotation_path kinetics.json \
--result_path results --dataset kinetics --resume_path results/save_200.pth \
--model_depth 50 --n_classes 700 --n_threads 4 --no_train --no_val --inference --output_topk 5 --inference_batch_size 1
Evaluate top-1 video accuracy of a recognition result (~/data/results/val.json).

python -m util_scripts.eval_accuracy ~/data/kinetics.json ~/data/results/val.json

Then I get the load_ground_truth function in utils_scripts/eval_accuracy.py which returns ground_truth 0. I think the following part of the code needs to be changed. Can someone tell me how to change it?
for video_id, v in data['database'].items():
        if subset != v['subset']:
            continue
        this_label = v['annotations']['label']
        ground_truth.append((video_id, class_labels_map[this_label]))

@YTHmamba did you find a solution for that !!
I get the same problem as you ??

Hello, do you know how to modify it? I also encountered this problem


Get GitHub Login required data

You must specify the information required to bring user information from his GitHub account, keep in mind that the token will be sent from the Client side (frontend - flutter) and our mission here is only to send it to GitHub and bring information based on it.
After identifying the information, add it to the class assigned to it, and do not forget if it is general information to define it in the father's class as well so that the other colleagues will determine their required information as well
if there is a scope you should make it controllable from our side

I will take this task


[9.x] Fix Duplicate Route Namespace

When you are using group namespaces you cannot use the group controller method or single action controllers.
Also you cannot use the controller class as a parameter on your route
Route::namespace($module->namespace().'\App\Http\Controllers')->group($module->getRoutes());

This works
Route::get('/', 'FrameworkController@index')->name('index');

The following scenarios are not working
Controller group
use Modules/Foo/App/Http/Controllers/FooController;
Route::prefix('foo')
    ->controller(FooController::class)
    ->group(function () {
        Route::get('/foo', 'foo');
    });

Single Action Controller
use Modules/Foo/App/Http/Controllers/InvokableController;
Route::prefix('foo')->group(function () {
        Route::get('/foo', InvokableController::class);
    });

use Modules/Foo/App/Http/Controllers/FooController;

Route::prefix('foo')->group(function () {
        Route::get('/', [FooController::class, 'index']);
    });

The solution I came up with is to not prepend the group namespace if the controller class starts with the same namespace

If you use controller classes in your route it's intended to not set the namespace. That's why it's disabled by default in the skeleton. You either use one or the other.

I get that it's disabled but is there a reason not being flexible no matter if you set a namespace?

When you have namespaced groups you cannot use the new controller method or even invokable controllers which I think we should allow to.
Main reason we have namespaced groups is when used with modules/domains which means including multiple route files.
Then we can check the namespace of the current route Route::getCurrentRoute()->getAction('namespace')
Invokable controllers should not be affected by group namespaces tho

When you have namespaced groups

That's what I'm trying to say: I think we removed this from the docs to no longer promote namespaced groups.


size not available as a PersonaContainer prop

For some reason, VSCode displays a type error for size in PersonaContainer

Thanks @alkpa I just checked and the options aren't inherited. Will get this sorted in the next release.

Thanks @alkpa I just checked and the options aren't inherited. Will get this sorted in the next release.
Great!


itBit Authenticated Requests Intermittently Yield Invalid Signature

I'm getting an issue with itBit where intermittently requests will fail with
Exception in thread "Thread-0" org.knowm.xchange.itbit.v1.dto.ItBitException: Your request lacked a valid signature, and could not be authenticated. (HTTP status code: 401)
but the rest of the time they work fine. If I run some simple polling code:
    public static void main(String[] args) {
		final Exchange itBit = ExchangeFactory.INSTANCE.createExchange(ItBitExchange.class.getName());
		ExchangeSpecification spec = itBit.getExchangeSpecification();
		spec.setApiKey(System.getenv("ITBIT_API_KEY"));
		spec.setSecretKey(System.getenv("ITBIT_SECRET_KEY"));
		spec.getExchangeSpecificParameters().put("userId", System.getenv("ITBIT_USERNAME"));
		spec.getExchangeSpecificParameters().put("walletId", System.getenv("ITBIT_WALLET"));
		itBit.applySpecification(spec);

		new Thread(new Runnable() {
			@Override
			public void run() {
				try {
					for (;; Thread.sleep(5000)) {
						AccountInfo ai = itBit.getPollingAccountService().getAccountInfo();
						System.out.println("Got account info: " + ai.toString());
					}
				} catch (InterruptedException | NotAvailableFromExchangeException | NotYetImplementedForExchangeException | ExchangeException | IOException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
		}).start();
	}

I'll get 5 or 10 successful responses
Got account info: AccountInfo [username=something, tradingFee=null, wallets={something=Wallet [id=something, name=Wallet, balances=[Balance [currency=SGD, total=0E-8, available=0E-8, frozen=0E-8, borrowed=0, loaned=0, withdrawing=0, depositing=0], Balance [currency=XBT, total=0.01990000, available=0.01990000, frozen=0E-8, borrowed=0, loaned=0, withdrawing=0, depositing=0], Balance [currency=EUR, total=0E-8, available=0E-8, frozen=0E-8, borrowed=0, loaned=0, withdrawing=0, depositing=0], Balance [currency=USD, total=0.05708100, available=0.05708100, frozen=0E-8, borrowed=0, loaned=0, withdrawing=0, depositing=0]]]}]
and then suddenly I'll get the invalid signature message. I've turned on trace logging for Rescu and verified that the nonce values and timestamps are correct, and I've looked at the code in ItBitHmacPostBodyDigest and it looks fine. Has anyone else had this issue, or could possible shed some light on what's happening?

are you using the latest code on the develop branch?

Yeah, he is.  We've also filed a bug with ItBit.  It would be nice to know if anyone else can reproduce this behavior as well.

@timmolter Yeah I am. Are you not getting the same issue that I am?

@bryan4887 @matthewdowney I get the same issue for a few years now, extensively debugged it with ItBit with no result. So unless there's a bug in the XChange code I haven't found (which is very possible) then it's a ItBit bug.

@jheusser Interesting! Thanks for the input. I feel like it has to be something on the itBit side of things, because if the signing algorithm were incorrect every request should fail, and printing the timestamp and nonce values doesn't show anything strange. Maybe itBit is incorrectly handling some other error as an invalid signature?

@matthewdowney I think we had a similar bug where only every so many calls used a timestamp that somehow lead to a wrongly signed message, but I don't think this is the case here. I kind of just came to the conclusion it's due to ItBit under load. Also the account request is usually the one that needs to hit the database making sure your balance is up to date, so takes longest.

Just to follow up, ItBit never responded so I went with the approach of a retry handler that would give it three tries, because I've seen the request succeed the second time every time so far.

I've been frequently getting the "request lacked a valid signature" errors from ItBit too.
I've seen, on several occasions, signature problems that stem from the fact that the server calculates the signature from a normalized form of the request body instead of the verbatim form that is sent in the request. E.g. the body may be reformatted, possibly because the json is first parsed, then serialized back to json, and the serialized form is used to calculate the signature.
I'm not claiming this is the case with ItBit, just something I've seen elsewhere.


Cluster render in wrong location

All clusters should be aligned to the actual asset locations.
Ideally, the map would be zoomed into to show all asset clusters and not display the entire globe.  Furthermore, when zooming, the map should stay centered on asset clusters displayed.

working fine with 1.1


Failed to crop image!

Failed to crop image!
null is not an object (evaluating 'RNCImageEditor.cropImage')

@vemarav please help me

yarn add vemarav/react-native-image-editor will fix the issue

closing due to inactivity


Prepare to release v1.0.0-RC2 (stable) / v0.22.0 (unstable)

https://github.com/GoogleCloudPlatform/opentelemetry-operations-go/releases/edit/untagged-51426c81a783f97c6b62

I just noticed that #200 is ready to merge, so I'll get that in and update this PR afterwards.

I think #200 requires another LGTM after reopening it.

@punya would be great to have this sooner than later :)


Unable to replace standard calc.exe with this app

When trying to replace calc.exe binary with renamed Calculator.exe, it doesn' work. It'll be great to add a button in app to easily change default calculator.

This is your friendly Microsoft Issue Bot. I've seen this issue come in and have gone to tell a human about it.

system32/calc.exe will launch the Windows Calculator app (downloaded from the Store). Changing calc.exe to launch a different app might be an interesting idea, but it would have to be implemented in Windows instead of in this app.


Why ThreadHints.onSpinWait() is not added for SleepingWaitStrategy

Hi,
Just noticed that ThreadHints.onSpinWait() is not added for SleepingWaitStrategy.
https://github.com/LMAX-Exchange/disruptor/blob/master/src/main/java/com/lmax/disruptor/SleepingWaitStrategy.java#L83
private int applyWaitMethod(final SequenceBarrier barrier, int counter)
        throws AlertException
    {
        barrier.checkAlert();

        if (counter > 100)
        {
            --counter;
            // added
            ThreadHints.onSpinWait()
        }
...

Is this intended?
Thank you,
Justin

Hi Justin,
This is a fair question, and one I don't think anyone has an answer for.
I looked around the codebase and many implementations of WaitStrategy have a busy-spin component where the thread hint could be applied.
While the code compiles and runs with the thread hint in what seem like appropriate places, I think we would need a benchmark to prove they provide some benefit and more importantly that they don't come at a cost.
I will leave this ticket open as benchmarks are something currently being worked upon in the Disruptor, and I would welcome any benchmarks or experimental data on this in the mean time.
Thanks,
Nick


IAR linker file extension '.icf' is not supported by projmgr exe

IAR linker file extension '.icf' is not supported by projmgr which results in IAR project build failure.
In cproject yml, we have
  - group: MIMXRT1064/iar
    files:
    - file: iar/MIMXRT1064xxxxx_ram.icf
      for-type:
      - ".debug"
      - ".release"
      for-compiler:
      - IAR
    - file: iar/MIMXRT1064xxxxx_sdram.icf
      for-type:
      - ".sdram_debug"
      - ".sdram_release"
      for-compiler:
      - IAR
    - file: iar/MIMXRT1064xxxxx_flexspi_nor.icf
      for-type:
      - ".flexspi_nor_debug"
      - ".flexspi_nor_release"
      for-compiler:
      - IAR

In the translated cprj, the data is
    <group name="MIMXRT1064/iar">
      <file category="other" name="iar/MIMXRT1064xxxxx_ram.icf"/>
    </group>

file category shall be 'linkerScript'.

@brondani we at IAR can try to fix this if you'd like

@ReinhardKeil  could you please add the extension .icf to identify a linker script in the YML-Input-Format

.icf got added to the the documentation and is supported in CMSIS-Toolbox 1.5.0


Google: Please update OpenLANE to OpenROAD HEAD for GF180MCU

Prompt
OpenROAD has fixed a number of issues related to GF180MCU, and OpenLANE needs to update to take advantage of them.
Proposal
Update OpenLANE to use OpenROAD head.

@QuantamHD
https://github.com/The-OpenROAD-Project/OpenLane/pull/1303 PR CI metrics failing.
@maliberty fixing this in https://github.com/The-OpenROAD-Project/OpenROAD/issues/2346.
Once CI passes ready to merge.


disconnect doesn't work if triggered by emit

Here's a minimal example, contrived, but just to illustrate the point:
import 'package:signals_slots/signals_slots.dart';

class Foo {
  late final Connection conn;
  final sig = Signal0();
  Foo() {
    conn = sig.connect(() {
      conn.disconnect();
    });
  }
}

void main() {
  final foo = Foo();
  foo.sig.emit();
}

Results in:
❯ dart main.dart
Unhandled exception:
Concurrent modification during iteration: Instance(length:0) of '_GrowableList'.
#0      ListIterator.moveNext (dart:_internal/iterable.dart:348:7)
#1      Signal0.emit (package:signals_slots/src/signal.dart:130:58)
#2      main (file:///Users/serj/lixo/sigtest/main.dart:15:11)
#3      _delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:297:19)
#4      _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:184:12)

Could this be supported ?

inside emit(), probably iterate on a copy of _connectionMap[group]!  instead

@iamsergio I've released 1.1.1 with changes to fix your issue. Please close out this issue after verifying it fixes your problem.

Problem fixed, thanks !


Parking Lot

Post any questions you may have here during the training.

QUESTIONS FOR RESEARCH:

[ ] Can I fetch the last X number of commits?

🎥 RECORDINGS WILL BE POSTED HERE


Iframe render issue

Clicking on any link inside the preview is rendering the whole webpage inside that iframe

Great spot chief, it's fixed in https://github.com/markmead/hyperui/commit/6bba229a443ffc2a3a787eb4a0fb63df77573f60


When refresh browser on prerender env(SSG), Authentication status is lost.

Environment

Operating System: Darwin
Node Version:     v18.17.1
Nuxt Version:     3.7.4
CLI Version:      3.9.0
Nitro Version:    2.6.3
Package Manager<EMAIL_ADDRESS>Builder:          -
User Config:      devtools, build, alias, ssr, runtimeConfig, nitro, vite, modules, auth, i18n, experimental, css, pinia, app
Runtime Modules<EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS>Build Modules:    -

client : npm run generate > npx serve [output static directory] -l 3001
node server :  npm run build(port 3000) > node index.mjs
Reproduction

Call signIn on Login Page.

        const { signIn, status } = useAuth();
	setUser(<resLoginType>returnData.value.rs);
	// await authLogin();
	const wrapBody = {
		username: loginId.value,
		password: passwd.value,

	};
	await signIn(wrapBody, { redirect: false });

	navigateTo('/main', { replace: true });

signin is authorize and then move main page. (Screenshots : Chrome Inspector Application > Cookie and check useAuth status value)

After refreshing the browser, useAuth status value is lost and move the login.

Describe the bug

Authentication passed on the login page.
Refreshed the main page.
Authentication status is lost and moved to the login page.

I guess this is probably a problem that occurs when pre-rendering is performed on the client-driven server side.
Is there a solution to this?
Additional context
"nuxt.config.ts" part the below.
import { resolve } from 'node:path';

// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
	devtools: { enabled: true },
	build: {
		transpile: ['vuetify', 'jsonwebtoken'],
	},
	alias: {
		'./runtimeConfig': './runtimeConfig.browser',
		cookie: resolve(__dirname, 'node_modules/cookie'),
	},

	ssr: true,
	runtimeConfig: {
		public: {
			baseApiUrl: process.env.BASE_API_URL,
			midAwsUrl: process.env.MIDDLEWARE_LAMBDA_URL,
			mode: process.env.ENV_MODE,
		},
	},

	nitro: {
		preset: 'node-server', //'aws-lambda',
		storage: { '.data:auth': { driver: 'fs', base: './.data/auth' } },
		routeRules: {
			'/': { ssr: true, prerender: true },
		},
	},
	vite: {
		envDir: process.cwd(),
		define: {
			'process.env.DEBUG': false,
			'window.global': {},
		},
		css: {
			preprocessorOptions: {
				scss: {
					additionalData: '@import <EMAIL_ADDRESS>',
				},
			},
		},
	},
	modules: [
		'@pinia/nuxt',
		'@pinia-plugin-persistedstate/nuxt',
		'@nuxtjs/i18n',
		'@sidebase/nuxt-auth',
	],
	auth: {
		provider: {
			type: 'local',
			token: {
				signInResponseTokenPointer: '/token/accessToken',
				maxAgeInSeconds: 18000,
				// sameSiteAttribute: 'lax',
			},
		},
		baseURL: 'http://localhost:3000/api/auth',

		globalAppMiddleware: {
			isEnabled: true,
		},
	},
	i18n: {
		strategy: 'no_prefix',
		locales: [
			{
				code: 'vi',
				name: 'Vietnamese',
				file: 'vi-VN.ts',
			},
			{
				code: 'en',
				name: 'English',
				file: 'en-US.ts',
			},
			{
				code: 'ko',
				name: 'Korean',
				file: 'ko-KR.ts',
			},
		],
		experimental: {
			jsTsFormatResource: true,
		},
		lazy: true,
		langDir: 'lang',
		defaultLocale: 'en',
	},
	experimental: {
		payloadExtraction: false,
	},
	css: ['vuetify/styles'<EMAIL_ADDRESS>	pinia: {
		autoImports: [
			// `defineStore`를 자동으로 임포트함.
			'defineStore', // import { defineStore } from 'pinia'
			['defineStore', 'definePiniaStore'], // import { defineStore as definePiniaStore } from 'pinia'
		],
	},
	app: {
		head: {
			title: 'D-Sales Store',
			// titleTemplate: 'input title template',
			link: [
				{ rel: 'stylesheet', href: '' },
				{ rel: 'preconnect', href: '' },
				{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
				// font - NotoSans 추가
				{
					rel: 'stylesheet',
					type: 'text/css',
					href: 'https://fonts.googleapis.com/css?family=Noto+Sans+KR:400,500,700',
				},
			],
		},
	},
});

Logs
No response

Same issue

Hi @artisthong, so this only happens when running the frontend statically, but not when you build it and run it through the Nuxt Server (AKA only happens when you run SSG and not SSR)?
Also, does the cookie get cleared on the reload of the page or is it kept?
Could you also provide a replication of your current setup? Otherwise it may take a bit longer for me to create a setup on which I can test this!

For me it cleared the cookied one we reloaded the page.

@zoey-kaiser Make sure you can make nuxt.config.ts
ssr: true,

Or leave it as by default.

@TouchSek If you tab in and out of your site does the authentication state fix itself?
Like this:

Navigates to https://yourwebsite.com/
Observe that the unauthenticated state is available to user ("Please sign in")
Clicks away into another tab
Clicks back on the https://yourwebsite.com/ tab
Observe that the authentication state is now showing ("Signed in as...")

I might have the same issue, I just wanna know if it's the same thing or not, so I can make my own issue.
Here is the reproducible example I made if you wanna compare:
Site: https://minimal-nuxt-app-git-using-isr-kylesmith0905.vercel.app/
Repo: https://github.com/KyleSmith0905/mre--nuxt-app/tree/using-isr

If either of you are having the problem I stated above, it's because Nuxt Auth is incorrectly passes down the authentication info when pages are being cached/prerendered. In dev tools run: console.log(useNuxtApp().payload.state['$sauth:loading']), observe that it logs as false, meaning that Nuxt Auth is not sending a loading state by default. Nuxt Auth also doesn't revalidate client side (nor does it need to).
As a cheap solution you can do this:
onMounted(() => {
	getSession()
})

Since auth.status isn't initially "loaded", you could add a custom loading status. (code untested)
const authLoading = ref(true);

onMounted(() => {
	getSession().then(() => loading.value = false)
})

Or as a better solution, you can probably create a composable (if you do, please share).
I was trying to slowly build a PR to fix (as I need this for a personal project). But I'm spending a lot of my personal time on work-related projects.
A permanent solution might be to:

Add a config option to turn off all server-side Nuxt Auth use (but there isn't fine grained control).
Detect if an option has prerender/isr/swr in routeRules (but there are some variables to this, example: Cloudflare might cache).
Add an option in the routeRules to turn off server-side Nuxt Auth functionality (but a lot of extra lines to the Nuxt config).

I'm also facing this issue using local provider with SSR. The auth state is fine during CSR, but try refreshing the page, or do navigation that is not using history and it's gone.
Here's the reproduction: https://stackblitz.com/edit/nuxt-starter-k4cqjg

Access login page and input any email and and password
The login will be successful and user will be redirected to protected page (/app)
Click any navigation link except Regular Link and the auth state is kept.
Click Regular Link, and it will bring user to another unprotected page.
Click back to app or login page and the auth state is gone (if clicking app, it'll redirect to login, if clicking login, it will render login page, even though user did not logout)

@gretchelin Your reproduction works fine preview is opened in new tab.

thanks for mentioning that @simkuns . I only recently remembered to check on this issue, and after testing the repro in new tab, yeah, it weirdly works. Will play around with the repro to see if it's something implementation-wise (as I use mock data in it, so that might be why it behave weirdly).

I tried to check this with<EMAIL_ADDRESS>with refresh provider(Many thanks for this feature), and have the same problem. I hosted the website on DigitalOcean using App Platform and the API is on Droplet using Symfony 6.3.*
As I see,

The token is not set or cleared immediately after login.
I also tried to use another API endpoint(another API project) to check login process, it work well (but not for latest project).

So, I not sure if this a good solution or not but I disable SSR and force set token again with useCookie and it work for me.
nuxt.config.ts
ssr: false,

auth: {
  globalAppMiddleware: {
    isEnabled: true,
  },
  baseURL: process.env.NUXT_PUBLIC_API_BASE + '/',
  provider: {
    type: 'refresh',
    endpoints: {
      signIn: { path: '/api/login', method: 'post' },
      signOut: false, // { path: '/api/token/invalidate', method: 'post' },
      signUp: { path: '/api/register', method: 'post' },
      getSession: { path: '/api/users/profile', method: 'get' },
      refresh: { path: '/api/token/refresh', method: 'post' },
    },
    token: {
      signInResponseTokenPointer: '/token',
      maxAgeInSeconds: 3600,
    },
    refreshToken: {
      signInResponseRefreshTokenPointer: '/refreshToken',
      maxAgeInSeconds: 3600 * 24 * 30,
    },
  },
  session: {
    enableRefreshPeriodically: false,
    enableRefreshOnWindowFocus: false,
  },
},

app.vue
const { token } = useAuth()

const jwt = useCookie('auth:token', {
  maxAge: 3600,
  expires: new Date(Date.now() + 3600 * 1000),
  path: '/',
  sameSite: 'lax',
  watch: true,
  default() {
    return token.value?.replace('Bearer ', '')
  },
})

watch(
  () => token.value,
  (value) => {
    jwt.value = value?.replace('Bearer ', '')
  },
  { immediate: true },
)

I hope we find out the better solution soon.

thanks for mentioning that @simkuns . I only recently remembered to check on this issue, and after testing the repro in new tab, yeah, it weirdly works. Will play around with the repro to see if it's something implementation-wise (as I use mock data in it, so that might be why it behave weirdly).

Hi, I've got the same problem as you stated above. After doing refresh or new tab etc auth state is gone (cookie is gone). Did you find out what was causing this?

try this code
auth: {
    ...
   cookie: {
            options: {
                expires: new Date(new Date().getTime() +<PHONE_NUMBER>0).getTime(), //thats today + a year
                maxAge: 31622400
            }
        }
   ...
}

If either of you are having the problem I stated above, it's because Nuxt Auth is incorrectly passes down the authentication info when pages are being cached/prerendered. In dev tools run: console.log(useNuxtApp().payload.state['$sauth:loading']), observe that it logs as false, meaning that Nuxt Auth is not sending a loading state by default. Nuxt Auth also doesn't revalidate client side (nor does it need to).
As a cheap solution you can do this:
onMounted(() => {
	getSession()
})

Since auth.status isn't initially "loaded", you could add a custom loading status. (code untested)
const authLoading = ref(true);

onMounted(() => {
	getSession().then(() => loading.value = false)
})

Or as a better solution, you can probably create a composable (if you do, please share).
I was trying to slowly build a PR to fix (as I need this for a personal project). But I'm spending a lot of my personal time on work-related projects.
A permanent solution might be to:

Add a config option to turn off all server-side Nuxt Auth use (but there isn't fine grained control).
Detect if an option has prerender/isr/swr in routeRules (but there are some variables to this, example: Cloudflare might cache).
Add an option in the routeRules to turn off server-side Nuxt Auth functionality (but a lot of extra lines to the Nuxt config).

Thanks to you I regained my sanity. Having an authenticating flash before loading the content on first load is an ugly solution but at least it's working now. Thank you. Did you ever got the time to come up with a better solution?

Thanks to you I regained my sanity. Having an authenticating flash before loading the content on first load is an ugly solution but at least it's working now. Thank you. Did you ever got the time to come up with a better solution?

I created a pull request (#610) to fix that issue. They're currently reviewing it. On the project I was having the issue, I just installed the fork I created, instead of using @sidebase/nuxt-auth. I deployed it to NPM, but I'm not sharing the package name since I probably won't keep it updated, lol.

#712 This PR fixes the data getting lost issue, but you still need to set the prerender:false for middleware protected routes in routeRules so that client-side middleware is forced to run and load the states.

I am working on a new nuxt project. I am seeing the same issue with

ssr: true
local provider
running with npm run dev

For anyone also facing this, KyleSmith fix did not fully work for me. The hack I came up with is to manually pull the auth token from the cookie before calling getSession():
const { rawToken } = useAuthState()
const authLoading = ref(true);

onMounted(() => {
    // Grab auth token from cookie
    const authToken = useCookie('auth.token');

    // Set raw token from Nuxt Auth
    rawToken.value = authToken.value;

    getSession({ force: true }).then(() => {
        authLoading.value = false
    });
})

For anyone who's only using the local provider of nuxt-auth I highly recommend implementing authentication without a package. It's simple yet effective.
This package is just not good at simple authentication flow with just the local provider. I've lost days trying to work around annoying bugs and over-engineered solutions for a simple Auth flow.

While we wait for a proper fix, I have created a Nuxt 3 plugin based on @RMFogarty's suggestion.
For static site generation (SSG), the authentication process, especially the handling of cookies, should primarily occur on the client side because cookies are not accessible at build time and are typically bound to the user's session.
// plugins/nuxt-auth-ssg.js
import { defineNuxtPlugin } from '#app'

export default defineNuxtPlugin(nuxtApp => {
    nuxtApp.hook('app:mounted', async () => {
        const { getSession } = useAuth()
        const { rawToken } = useAuthState()
        const authLoading = ref(true);

        // Initialize authentication state on client-side when app is mounted
        if (process.client) {
            const authToken = useCookie('auth.token');

            // Set raw token from Nuxt Auth
            rawToken.value = authToken.value;

            try {
                await getSession({ force: true });
            } catch (error) {
                console.error('Failed to initialize session:', error);
            } finally {
                authLoading.value = false;
            }
        }
    })
})

While we wait for a proper fix, I have created a Nuxt 3 plugin based on @RMFogarty's suggestion.
For static site generation (SSG), the authentication process, especially the handling of cookies, should primarily occur on the client side because cookies are not accessible at build time and are typically bound to the user's session.
This plugin should work for provider type "refresh" and "local".
// plugins/nuxt-auth-ssg.js
import { defineNuxtPlugin } from '#app';
import { useState } from '#imports';

export default defineNuxtPlugin(nuxtApp => {
    const authLoading = useState('authLoading', () => ref(true));  // Initialize and provide globally

    nuxtApp.hook('app:mounted', async () => {
        const { getSession, refresh } = useAuth();
        const { rawToken, rawRefreshToken } = useAuthState();

        if (process.client) {
            const authToken = useCookie('auth.token');
            const authRefreshToken = useCookie('auth.refresh-token');

            // Only proceed if there is at least an authToken
            if (authToken.value) {
                rawToken.value = authToken.value;
                if (authRefreshToken.value && rawRefreshToken) {
                    rawRefreshToken.value = authRefreshToken.value;
                }

                try {
                    const authMethod = refresh && authRefreshToken.value ? refresh : getSession;
                    await authMethod({ force: true });
                } catch (error) {
                    console.error('Failed to initialize session:', error);
                    // Optionally update state or notify users that an error occurred
                } finally {
                    authLoading.value = false; // Ensure loading is set to false when done
                }
            } else {
                authLoading.value = false; // Set loading false if no auth token
            }
        }
    });
});

Now, you can inject "authLoading" in any component where you need it.

<template>

    Loading...

</template>

While we wait for a proper fix, I have created a Nuxt 3 plugin based on @RMFogarty's suggestion.
For static site generation (SSG), the authentication process, especially the handling of cookies, should primarily occur on the client side because cookies are not accessible at build time and are typically bound to the user's session.
This plugin should work for provider type "refresh" and "local".
// plugins/nuxt-auth-ssg.js
import { defineNuxtPlugin } from '#app';
import { useState } from '#imports';

export default defineNuxtPlugin(nuxtApp => {
    const authLoading = useState('authLoading', () => ref(true));  // Initialize and provide globally

    nuxtApp.hook('app:mounted', async () => {
        const { getSession, refresh } = useAuth();
        const { rawToken, rawRefreshToken } = useAuthState();

        if (process.client) {
            const authToken = useCookie('auth.token');
            const authRefreshToken = useCookie('auth.refresh-token');

            // Only proceed if there is at least an authToken
            if (authToken.value) {
                rawToken.value = authToken.value;
                if (authRefreshToken.value && rawRefreshToken) {
                    rawRefreshToken.value = authRefreshToken.value;
                }

                try {
                    const authMethod = refresh && authRefreshToken.value ? refresh : getSession;
                    await authMethod({ force: true });
                } catch (error) {
                    console.error('Failed to initialize session:', error);
                    // Optionally update state or notify users that an error occurred
                } finally {
                    authLoading.value = false; // Ensure loading is set to false when done
                }
            } else {
                authLoading.value = false; // Set loading false if no auth token
            }
        }
    });
});

Now, you can inject "authLoading" in any component where you need it.

<template>

    Loading...

 {{ status }}

</template>

@ralphcrisostomo tried you solution but auth middleware redirects to login page earlier than plugin executed. Am I doing something wrong?

@ralphcrisostomo tried your solution but auth middleware redirects to login page earlier than plugin executed. Am I doing something wrong?

Could you share your code so I can understand your issue clearly.

Could you share your code so I can understand your issue clearly.

I checked it in this reproduction and it still logout
https://github.com/sidebase/nuxt-auth/issues/551#issuecomment-1838126794

Could you share your code so I can understand your issue clearly.

I checked it in this reproduction and it still logout
https://github.com/sidebase/nuxt-auth/issues/551#issuecomment-1838126794

My pull request #712 still hasn't been reviewed yet, meanwhile if anyone is facing the problem you can install my version @vijayabhaskar96/nuxt-auth
It simply stores the session data as cookie and loads it back if available. If you're navigation guarding some routes, disable prerendering for those routes so client side middleware can handle things properly.

@ralphcrisostomo tried your solution but auth middleware redirects to login page earlier than plugin executed. Am I doing something wrong?

Could you share your code so I can understand your issue clearly.

You could try out this auth module instead @workmate/nuxt-auth. This works for me

Is this issue still unresolved?!!!
Any one has a solution?? @artisthong

After long and painstaking research, I found this:
const { data } = await useFetch('/api/example', { headers })```

this will set cookies from the client side to the request you want in the Nuxt server side


handler tests execution is not stable

Executed inside GitPod set to use main branch (nothing more special).
At https://github.com/deep-foundation/deeplinks/commit/e0c140250f724c2f2b13e53a760ad92d14933480

GPT-4 thoughts (converstion https://chat.openai.com/share/d5be5bad-2756-4edb-b8a7-aa76c16ecf9d):
The issue titled "handler tests execution is not stable" is very brief and doesn't provide enough information to give specific suggestions. It's mentioned that the issue occurs when executed inside GitPod on the main branch, but no further details are provided about the nature of the instability, any error messages, the expected versus the actual behavior, etc【5†source】.
In general, when dealing with unstable tests, here are a few suggestions:

Isolate the issue: Try to identify a minimal test case that reproduces the problem. This could involve disabling certain tests to see if the issue persists.

Examine logs and errors: Any output from the failing tests can be extremely helpful. Look for any error messages, stack traces, etc., that could give clues about what's going wrong.

Consider external factors: Sometimes tests can fail due to issues with the environment, such as network connectivity problems, timing issues, etc. If the tests involve any external services or resources, these should be investigated as potential sources of instability.

Check for race conditions or timing issues: If tests are asynchronous or involve concurrency, they may sometimes pass and sometimes fail due to race conditions or timing issues.

Use debugging tools: Depending on the language and testing framework you're using, there may be tools available to help debug the tests. This could involve running the tests in a debugger, using print statements or logging to output additional information, etc.

Given more details about the specific problem, I could provide more targeted advice.


Migration code emits warning if migration already done

Saw this in my calico/node logs:
2017-12-18 19:18:51.080 [WARNING][9] migrate.go 725: Cannot migrate from version v3.0.0-beta1-128-g1caef47d

Expected Behavior

Something like "No migration needed."
Current Behavior

Scary log (possibly intended for the migration tool output instead of startup.go?)
Possible Solution

Steps to Reproduce (for bugs)

Context

Your Environment

Calico version

$ kubectl exec -n kube-system calico-node-wszl8  versions
Defaulting container name to calico-node.
Use 'kubectl describe pod/calico-node-wszl8' to see all of the containers in this pod.
confd v1.0.0-beta1-6-g47ad71a
libnetwork-plugin: BIRD version 1.6.3
v1.1.2-rc1
calico-bgp-daemon: v0.2.2

Felix:
2017-12-18 19:25:27.224 [INFO][3311] logutils.go 79: Early screen log level set to info
Version:            3.0.0-beta1-67-gd937868f
Full git commit ID: d937868fa4dc0dd04d61db280c8678ade6b18566
Build date:         2017-12-18T08:00:43+0000

Orchestrator version (e.g. kubernetes, mesos, rkt):

 kubectl version
Client Version: version.Info{Major:"1", Minor:"8", GitVersion:"v1.8.3", GitCommit:"f0efb3cb883751c5ffdbe6d515f3cb4fbe7b7acd", GitTreeState:"clean", BuildDate:"2017-11-08T18:39:33Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"8+", GitVersion:"v1.8.4-gke.0", GitCommit:"04502ae78d522a3d410de3710e1550cfb16dad4a", GitTreeState:"clean", BuildDate:"2017-11-27T19:19:56Z", GoVersion:"go1.8.3b4", Compiler:"gc", Platform:"linux/amd64"}

Operating System and version: COS
Link to your project (optional):

This was fixed by https://github.com/projectcalico/libcalico-go/pull/756 but we may want a retest. @fasaxc WDYT?

I didn't see the message in my tests.  Looks fixed.


[library] Use reset signal for each multi-cycle primitive.

Closes #764. Not sure if there's some reason why we wouldn't want this; it seems this is the way though for support on both FPGA and ASIC.

Hmm some issues with the golden output. It seems its not using the correct outputs in the original code:
https://github.com/cucapra/calyx/blob/6983e03617cb1265926de51ae05fa0747807a759/primitives/binary_operators.sv#L479-L500

Can you explain what you mean by that?

Can you explain what you mean by that?

Its using dividend and remainder to check the standard, instead of out_remainder, out_quotient. Changing the standard to use the latter two breaks this test case, even without this PR. Unsure why.

It's because those two registers get updated in the cycle after finished is high. It's always important to figure out when things execute and what thing would be driven when. Another common problem is that left and right are not driven when done is high.

It's because those two registers get updated in the cycle after finished is high. It's always important to figure out when things execute and what thing would be driven when. Another common problem is that left and right are not driven when done is high.

Yep that was it; we want it to run when done is driven, not finished. Also the l and r not being driven. I latched these values since that's what sqrt was doing and this is for testing purposes only. However, I can change it to always_ff like the signed division was doing previously.


Question about Mongodb distinct

I'm using mongodb driver so I can't use query builder. How can this be achieved?
db.inventory.distinct( "prices", { dept: "A" } )

em.getConnection().getCollection('prices').distinct({ dept: 'A' })

Make sure your em is correctly typed as EntityManager<MongoDriver> otherwise the getCollection method won't be there.

Thanks for the help but I think the correct answer would be:
em.getConnection().getCollection('inventory').distinct('prices', { dept: 'A' });


Check if config file exists before removal on uninstall

Fixes #195
Changes

Checks if config_file is present before performing uninstall

Felt this could be the simple fix applicable, please to let know if any side effects are missed.

thanks for making the fix. lgtm


Added multiple pointer actions for select and hold

Overview
Added the ability to specify multiple select and hold actions as well as single axis actions and not just binary ones.
Added a select and hold threshold value for single axis press actions.
Breaking Changes

Any prefabs with scripts that derive from BaseControllerPointer will need to have their hold and select actions updated.

Looks good to me, nice and clean.  But would like @provencher to also cast his eye over.

I don't really understand the reason for this PR - It feels a bit backwards.
Reading this code, it seems like the input system will trigger a pointer down call on this pointer, which then triggers a select call back to the input system. This change then adds more possible input system events to catch when the pointer down call is triggered, which feels backwards.
IMO, the pointer shouldn't be triggering input system calls. It should receive events from the input system, which are then fed down into the pointer interaction receiver. A pointer is something that should exist alongside Controllers, who should bear the responsibility of triggering the input system.

IMO, the pointer shouldn't be triggering input system calls. It should receive events from the input system, which are then fed down into the pointer interaction receiver. A pointer is something that should exist alongside Controllers, who should bear the responsibility of triggering the input system.

As much as I'd love to change that today that's beyond the scope of this pr.

Agreed, this is a good first step along a journey to get to the position we want, without radicalising the framework.
@provencher could you create an issue proposal with the remaining gaps you see, so we can plan the next steps?

I wanna test this before merging. I saw some issues with the pointer results when testing on ML

Just changed my review to avoid accidental merging :D. Also put a call out in General for others to acquaint themselves with the change

You have several notable actions against yourself in this PR @StephenHodgson , can you either do the updates or remove the comments / actions?


What is the network speed between nodes?

❓ Questions and Help
Hi, may I ask what is the bandwidth between two nodes. Based on the throughput speed, you were probably using 400Gbps (or 50GB/s).
Before asking:

search the issues.
search the docs.

What is your question?
Code

What have you tried?
What's your environment?

metaseq Version (e.g., 1.0 or master):
PyTorch Version (e.g., 1.0)
OS (e.g., Linux):
How you installed metaseq (pip, source):
Build command you used (if compiling from source):
Python version:
CUDA/cuDNN version:
GPU models and configuration:
Any other relevant information:

@yhcc unfortunately we can't discuss specifics related to our cluster setup


Scrambling batches when flattening feature vector

After each iteration of the while loop you end up with a tensor of shape [batch_size, 1, 1, num_filters] that you append to a list.
So you end up with a list, of size len(filter_sizes), of tensors of shape [batch_size, 1, 1, num_filters], basically pooled_outputs will have shape [len(filter_sizes), batch_size, 1, 1, num_filters].
After tf.concat(3, pooled_outputs) you will have shape [len(filter_sizes), batch_size, 1, num_filters].
From my understanding the first dimension is "len(filter_sizes)" the different dimension sizes, and the second is the different batches.
If you apply tf.reshape(self.h_pool, [-1, num_filters_total]) to this, you will get a feature vector of shape [batch_size, num_filters_total]
But won't you scramble the different batches? Instead of creating each "new" batch (the batch dimension in the final feature vector) from flattening each "old" batches; instead you will have each "new" batch created from more than one "old" batches and a single filter size? Because you are flattening each filter_size.
Am I missing something?

[batch_size, 1, 1, num_filters * (lenfilter_sizes)]


Schedulers don't work

Bug description
I'm on pytorch_lightning 2.09.
I've configured my optimizer with the below code on my plmodule. The learning rate is never updated...
    def configure_optimizers(self):
        optimizer = torch.optim.Adam(self.parameters(), lr=self.lr)
        scheduler = get_linear_schedule_with_warmup(
            optimizer,
            num_warmup_steps=10,
            num_training_steps=self.trainer.max_epochs
        )
        return dict(optimizer=optimizer, lr_scheduler=dict(scheduler=scheduler, interval="step", frequency=1))

What version are you seeing the problem on?
v2.0
How to reproduce the bug
No response
Error messages and logs
# Error messages and logs here please

Environment

Current environment
#- Lightning Component (e.g. Trainer, LightningModule, LightningApp, LightningWork, LightningFlow):
#- PyTorch Lightning Version (e.g., 1.5.0):
#- Lightning App Version (e.g., 0.5.2):
#- PyTorch Version (e.g., 2.0):
#- Python version (e.g., 3.9):
#- OS (e.g., Linux):
#- CUDA/cuDNN version:
#- GPU models and configuration:
#- How you installed Lightning(`conda`, `pip`, source):
#- Running environment of LightningApp (e.g. local, cloud):

More info
No response
cc @borda

@ririya Can you provide a code that reproduces this problem? Most importantly, please thare the code including get_linear_schedule_with_warmup. Right now there is not much we can work with to help you here.

I made some changes and it started working, maybe some imports or their order are affecting it? I can't afford to deep much deeper into it, but here are the non working and working codes:
NOT WORKING:
import os
import logging
import json
import torch
import torch.nn as nn
import numpy as np
from typing import List, Tuple
from functools import reduce
import pytorch_lightning as pl
from nltk import edit_distance
from collections import Counter, defaultdict
from torch.optim.lr_scheduler import StepLR, CosineAnnealingLR
from transformers.optimization import get_linear_schedule_with_warmup
from traineval.training.distributed import get_global_rank

class EntityResolutionNet(pl.LightningModule):
    def __init__(self, model, **kwargs):
        super().__init__()
        self.model = model
        self.save_hyperparameters(kwargs)
        self.lr = self.hparams.get("lr", 1e-4)
        self.lr_scheduler_step = self.hparams.get("lr_scheduler_step")
        self.lr_scheduler_gamma = self.hparams.get("lr_scheduler_gamma")
        # self.validation_step_outputs = {"val_loss": [], "total_val_correct": [], "total_correct_words": [], "total_val_samples": [], "total_samples_words":[]}
        self.validation_step_outputs = defaultdict(list)
        self.val_corr_per_class = {}
        self.dev = next(model.parameters()).device

        self.steps = 0
        self.log_every = 10
        self.total_loss = 0
        self.total_correct = 0
        self.total_samples = 0
        self.total_correct_words=0
        self.total_samples_words=0

        self.result = []

    def training_step(self, batch, batch_idx):

        input_ids = batch['anchor_ids']
        attention_mask = batch['anchor_mask']
        labels = batch['positive_ids']

        outputs = self.model(input_ids=input_ids, attention_mask=attention_mask, labels=labels)
        loss = outputs.loss
        logits = outputs.logits

        self.total_loss += loss.item()

        # Calculate accuracy
        predicted_ids = torch.argmax(logits, dim=-1)
        #check if all elements in second dimension are equal

        correct = torch.sum(predicted_ids == labels)
        self.total_correct += correct.item()
        self.total_samples += labels.numel()
        correct = torch.sum(torch.all(predicted_ids == labels, dim=1))
        self.total_correct_words += correct.item()
        self.total_samples_words += predicted_ids.size(0)

        self.steps += 1

        if self.steps % self.log_every == 0:
        # if True:
            #
            print("Train Loss", self.total_loss / self.total_samples)
            print("Accuracy/train", self.total_correct / self.total_samples)
            print('Word Accuracy/train', self.total_correct_words / self.total_samples_words)

            self.log("Train_Loss", self.total_loss / self.total_samples, prog_bar=True, logger=True, sync_dist=True)
            self.log("Train_Accuracy", self.total_correct / self.total_samples, prog_bar=True, logger=True, sync_dist=True)
            self.log('Train_Word_Accuracy', self.total_correct_words / self.total_samples_words, prog_bar=True, logger=True, sync_dist=True)

            self.total_loss = 0
            self.total_correct = 0
            self.total_samples = 0
            self.total_correct_words=0
            self.total_samples_words=0

        return loss

    def validation_step(self, batch, batch_idx, dataset_idx=0):
        input_ids = batch['anchor_ids']
        attention_mask = batch['anchor_mask']
        labels = batch['positive_ids']
        gt_in_train_batch = batch['gt_in_train']
        ocr_errors = batch['ocr_errors'] if 'ocr_errors' in batch else None
        missing_mappings = batch['missing_mappings'] if 'missing_mappings' in batch else None

        outputs = self.model(input_ids=input_ids, attention_mask=attention_mask, labels=labels)

        loss = outputs.loss
        logits = outputs.logits

        total_val_loss = loss.item()

        # Calculate accuracy
        predicted_ids = torch.argmax(logits, dim=-1)
        correct = torch.sum(predicted_ids == labels)
        total_val_correct = correct.item()
        total_val_samples = labels.numel()
        # word accuracy
        correct_words = torch.all(predicted_ids == labels, dim=1)
        total_correct_words = torch.sum(correct_words).item()
        total_samples_words = predicted_ids.size(0)

        #word accuracy in train
        #get sum of all predicted_ids == labels & the respective total_words_in_train==True
        correct_words_in_train = torch.sum(torch.all(predicted_ids == labels, dim=1) & gt_in_train_batch)
        total_correct_words_in_train = correct_words_in_train.item()
        total_words_in_train = torch.sum(gt_in_train_batch).item()

        self.validation_step_outputs["val_loss"].append(total_val_loss)
        self.validation_step_outputs["total_val_correct"].append(total_val_correct)
        self.validation_step_outputs["total_correct_words"].append(total_correct_words)
        self.validation_step_outputs["total_val_samples"].append(total_val_samples)
        self.validation_step_outputs["total_samples_words"].append(total_samples_words)
        self.validation_step_outputs["total_correct_words_in_train"].append(total_correct_words_in_train)
        self.validation_step_outputs["total_words_in_train"].append(total_words_in_train)

        correct_words = correct_words.cpu().numpy()
        if ocr_errors is not None:
            corrected_ocr = correct_words & ocr_errors.cpu().numpy()
            total_corrected_ocr = np.sum(corrected_ocr)
            self.validation_step_outputs["total_corrected_ocr"].append(total_corrected_ocr)
            total_ocr_errors = ocr_errors.sum().item()
            self.validation_step_outputs["total_ocr_errors"].append(total_ocr_errors)
        if missing_mappings is not None:
            corrected_missing_mappings = correct_words & missing_mappings.cpu().numpy()
            total_corrected_missing_mappings = np.sum(corrected_missing_mappings)
            self.validation_step_outputs["total_corrected_missing_mappings"].append(total_corrected_missing_mappings)
            total_missing_mappings = missing_mappings.sum().item()
            self.validation_step_outputs["total_missing_mappings"].append(total_missing_mappings)

    def on_validation_epoch_end(self):
        results = {
            "val_loss": sum(self.validation_step_outputs["val_loss"])*1.0 / sum(self.validation_step_outputs["total_val_samples"]),
            "val_accuracy": sum(self.validation_step_outputs["total_val_correct"])*1.0 / sum(self.validation_step_outputs["total_val_samples"]),
            "val_word_accuracy": sum(self.validation_step_outputs["total_correct_words"])*1.0 / sum(self.validation_step_outputs["total_samples_words"]),
            "val_words_in_train_acc": sum(self.validation_step_outputs["total_correct_words_in_train"])*1.0 / sum(self.validation_step_outputs["total_words_in_train"]),
        }
        if 'total_corrected_ocr' in self.validation_step_outputs:
            results["ocr_acc"] = sum(self.validation_step_outputs["total_corrected_ocr"])*1.0 / sum(self.validation_step_outputs["total_ocr_errors"])
        if 'total_corrected_missing_mappings' in self.validation_step_outputs:
            results["missing_mapping_acc"] = sum(self.validation_step_outputs["total_corrected_missing_mappings"])*1.0 / sum(self.validation_step_outputs["total_missing_mappings"])

        self.log('current_epoch', self.current_epoch, on_step=False, on_epoch=True, logger=True, prog_bar=True)
        # # Log final validation metrics
        # if get_global_rank() == 0:
        self.log_dict(
        results,
        prog_bar=True,
        logger=True,
        sync_dist=False,
        on_step=False,
        on_epoch=True,
        )

        logging.info(f"Eval Metrics: {json.dumps(results, indent=2)}")

    def configure_optimizers(self):
        optimizer = torch.optim.Adam(self.parameters(), lr=self.lr)
        # scheduler = StepLR(optimizer, step_size=self.lr_scheduler_step, gamma=0.5)
        # scheduler = CosineAnnealingLR(optimizer, T_max=self.trainer.max_epochs)
        # lr_scheduler = {'scheduler': scheduler, 'interval': 'epoch', 'monitor': 'val_loss'}
        scheduler = get_linear_schedule_with_warmup(
            optimizer,
            num_warmup_steps=self.n_warmup_steps,
            num_training_steps=self.trainer.max_epochs
        )

        return dict(optimizer=optimizer, lr_scheduler=dict(scheduler=scheduler, interval="step"))
        # return [optimizer], [scheduler]

WORKING:
import faiss
from collections import defaultdict
import logging
import json
from tqdm import tqdm, trange
import torch
import torch.nn as nn
import torch.nn.functional as F
import pytorch_lightning as pl
# import lightning.pytorch as pl
from transformers import AutoTokenizer, AutoModel
from transformers.optimization import get_linear_schedule_with_warmup
import numpy as np
import time

class EntityResolutionNet(pl.LightningModule):

    def __init__(self, model, **kwargs):
        super().__init__()
        self.model = model
        self.similarity_fct = torch.nn.CosineSimilarity()
        self.loss_fn = torch.nn.CrossEntropyLoss()
        self.similarity_scale: float = 20.0
        self.lr: float = kwargs['lr']
        self.scheduler_type = kwargs['scheduler_type']
        # self.lr = 0.001
        self.n_warmup_steps: int = 10
        self.validation_step_outputs = defaultdict(list)
        self.index_cos = None
        self.all_sentences = []
        self.all_embeddings = []
        self.steps = 0
        self.log_every = 10
        self.total_loss = 0
        self.total_correct = 0
        self.total_samples = 0
        self.total_correct_words=0
        self.total_samples_words=0
        self.scheduler = None
        self.save_hyperparameters(kwargs)

    def training_step(self, batch, batch_idx):

        input_ids = batch['anchor_ids']
        attention_mask = batch['anchor_mask']
        labels = batch['positive_ids']

        outputs = self.model(input_ids=input_ids, attention_mask=attention_mask, labels=labels)
        loss = outputs.loss
        logits = outputs.logits

        self.total_loss += loss.item()

        # Calculate accuracy
        predicted_ids = torch.argmax(logits, dim=-1)
        #check if all elements in second dimension are equal

        correct = torch.sum(predicted_ids == labels)
        self.total_correct += correct.item()
        self.total_samples += labels.numel()
        correct = torch.sum(torch.all(predicted_ids == labels, dim=1))
        self.total_correct_words += correct.item()
        self.total_samples_words += predicted_ids.size(0)

        self.steps += 1

        if self.steps % self.log_every == 0:

            print("Train Loss", self.total_loss / self.total_samples)
            print("Accuracy/train", self.total_correct / self.total_samples)
            print('Word Accuracy/train', self.total_correct_words / self.total_samples_words)

            self.log("Train_Loss", self.total_loss / self.total_samples, prog_bar=True, logger=True, sync_dist=True)
            self.log("Train_Accuracy", self.total_correct / self.total_samples, prog_bar=True, logger=True, sync_dist=True)
            self.log('Train_Word_Accuracy', self.total_correct_words / self.total_samples_words, prog_bar=True, logger=True, sync_dist=True)

            self.total_loss = 0
            self.total_correct = 0
            self.total_samples = 0
            self.total_correct_words=0
            self.total_samples_words=0

        return loss

    def validation_step(self, batch, batch_idx, dataset_idx=0):
        pass
        input_ids = batch['anchor_ids']
        attention_mask = batch['anchor_mask']
        labels = batch['positive_ids']
        gt_in_train_batch = batch['gt_in_train']
        ocr_errors = batch['ocr_errors'] if 'ocr_errors' in batch else None
        missing_mappings = batch['missing_mappings'] if 'missing_mappings' in batch else None

        outputs = self.model(input_ids=input_ids, attention_mask=attention_mask, labels=labels)

        loss = outputs.loss
        logits = outputs.logits

        total_val_loss = loss.item()

        # Calculate accuracy
        predicted_ids = torch.argmax(logits, dim=-1)
        correct = torch.sum(predicted_ids == labels)
        total_val_correct = correct.item()
        total_val_samples = labels.numel()
        # word accuracy
        correct_words = torch.all(predicted_ids == labels, dim=1)
        total_correct_words = torch.sum(correct_words).item()
        total_samples_words = predicted_ids.size(0)

        #word accuracy in train
        #get sum of all predicted_ids == labels & the respective total_words_in_train==True
        correct_words_in_train = torch.sum(torch.all(predicted_ids == labels, dim=1) & gt_in_train_batch)
        total_correct_words_in_train = correct_words_in_train.item()
        total_words_in_train = torch.sum(gt_in_train_batch).item()

        self.validation_step_outputs["val_loss"].append(total_val_loss)
        self.validation_step_outputs["total_val_correct"].append(total_val_correct)
        self.validation_step_outputs["total_correct_words"].append(total_correct_words)
        self.validation_step_outputs["total_val_samples"].append(total_val_samples)
        self.validation_step_outputs["total_samples_words"].append(total_samples_words)
        self.validation_step_outputs["total_correct_words_in_train"].append(total_correct_words_in_train)
        self.validation_step_outputs["total_words_in_train"].append(total_words_in_train)

        correct_words = correct_words.cpu().numpy()
        if ocr_errors is not None:
            corrected_ocr = correct_words & ocr_errors.cpu().numpy()
            total_corrected_ocr = np.sum(corrected_ocr)
            self.validation_step_outputs["total_corrected_ocr"].append(total_corrected_ocr)
            total_ocr_errors = ocr_errors.sum().item()
            self.validation_step_outputs["total_ocr_errors"].append(total_ocr_errors)
        if missing_mappings is not None:
            corrected_missing_mappings = correct_words & missing_mappings.cpu().numpy()
            total_corrected_missing_mappings = np.sum(corrected_missing_mappings)
            self.validation_step_outputs["total_corrected_missing_mappings"].append(total_corrected_missing_mappings)
            total_missing_mappings = missing_mappings.sum().item()
            self.validation_step_outputs["total_missing_mappings"].append(total_missing_mappings)

    def on_validation_epoch_end(self):
        results = {
            "val_loss": sum(self.validation_step_outputs["val_loss"])*1.0 / sum(self.validation_step_outputs["total_val_samples"]),
            "val_accuracy": sum(self.validation_step_outputs["total_val_correct"])*1.0 / sum(self.validation_step_outputs["total_val_samples"]),
            "val_word_accuracy": sum(self.validation_step_outputs["total_correct_words"])*1.0 / sum(self.validation_step_outputs["total_samples_words"]),
            "val_words_in_train_acc": sum(self.validation_step_outputs["total_correct_words_in_train"])*1.0 / sum(self.validation_step_outputs["total_words_in_train"]),
        }
        if 'total_corrected_ocr' in self.validation_step_outputs:
            results["ocr_acc"] = sum(self.validation_step_outputs["total_corrected_ocr"])*1.0 / sum(self.validation_step_outputs["total_ocr_errors"])
        if 'total_corrected_missing_mappings' in self.validation_step_outputs:
            results["missing_mapping_acc"] = sum(self.validation_step_outputs["total_corrected_missing_mappings"])*1.0 / sum(self.validation_step_outputs["total_missing_mappings"])

        self.log('current_epoch', self.current_epoch, on_step=False, on_epoch=True, logger=True, prog_bar=True)

        self.log_dict(
        results,
        prog_bar=True,
        logger=True,
        sync_dist=False,
        on_step=False,
        on_epoch=True,
        )

        if self.scheduler:

            lr = self.lr_schedulers().get_last_lr()[0]

            self.log('learning_rate', lr, on_step=False, on_epoch=True, logger=True, prog_bar=True)  # Logging the learning rate

        # logging.info(f"Eval Metrics: {json.dumps(results, indent=2)}")

    def configure_optimizers(self):
        """

        :return:
        """
        optimizer = torch.optim.Adam(self.parameters(), lr=self.lr)
        if self.scheduler_type == 'cosine':
            from torch.optim.lr_scheduler import StepLR, CosineAnnealingLR, LinearLR
            self.scheduler = CosineAnnealingLR(optimizer, T_max=self.trainer.max_epochs)
            return dict(optimizer=optimizer, lr_scheduler=dict(scheduler=self.scheduler, interval="epoch"))
        else:
            return optimizer

    # def configure_optimizers(self):
    #     optimizer = torch.optim.Adam(self.parameters(), lr=self.lr)
    #     # scheduler = StepLR(optimizer, step_size=self.lr_scheduler_step, gamma=0.5)
    #     # scheduler = LinearLR(optimizer, 0.1, 0.9, total_iters=4)
    #     # scheduler = CosineAnnealingLR(optimizer, T_max=self.trainer.max_epochs)

    #     scheduler = get_linear_schedule_with_warmup(
    #         optimizer,
    #         # num_warmup_steps=self.n_warmup_steps,
    #         num_warmup_steps=10,
    #         num_training_steps=self.trainer.max_epochs
    #     )

    #     lr_scheduler = {'scheduler': scheduler, 'interval': 'step'}
    #     # return {'optimizer': optimizer, 'lr_scheduler': scheduler}

    #     return dict(optimizer=optimizer, lr_scheduler=dict(scheduler=scheduler, interval="step", frequency=1))
    #     # return [optimizer], [scheduler]

You set the num training steps to max_epochs but the interval for scheduling to "step". Is this intentional? This seems very odd. Can you check please?

@awaelchli Yes the interval is wrong. I already fixed it in the working version. But that wasn't the problem setting it to step would just make the learning rate decay faster, the problem is it was not decaying at all.

If num_warmup_steps > num_training_step it can't decay! This is likely the case if you accidentally set num_training_step to max_epochs (and max_epochs is a small number). What are these values in your case?

Just to confirm setting the interval to “epochs” is another option right? Like I mentioned, I was seeing the problem with every single scheduler, nothing to do with the warm up. I really think there’s a big problem here

One more thing I was trying to run the lr finder and ran into the same problem. The finder was running 100 steps with the same learning rate. As the finder also uses a scheduler, I assume it’s the same problem. Once I fixed the plmodule the lr finder also started working. I’m not sure exactly what’s the problem, but I was thinking it could be something with the imports.

Ok thanks. I'm closing the issue since there is no clear indication what is not working. If you ever come back to it, or someone else finds and issue that we can reproduce, we can reopen the investigation.


Cryptic Clue Indicator Bug (proximity issue?)

Type
Incorrect behavior
Operating System
Windows
OS Version
Windows 11
Bug description
I searched through the issue listing and Q&A listings and did not find a similar addressed issue but if I missed something apologies.
Situation: solving easy clue scroll.
Cryptic clue: Belladonna, my dear. If only I had gloves, then I could hold you at last.
RuneLite clue hint: Talk to Tool Leprechaun at Draynor Manor.
Issue: on the world map, the indicator points indeed to the Belladonna patch Tool Leprechaun at Draynor Manor. The problem I encountered was that depending on proximity to either the correct Tool Leprechaun or the next closest Tool Leprechaun just north of the cabbage field south of Falador, the indicator on the view screen would point to the incorrect Tool Leprechaun. Not sure if this is case specific or indicative of a more general proximity issue regarding clue scrolls.
Screenshots or videos

RuneLite version
RuneLite version: 1.9.9
Launcher version: 2.1.0
Logs
No response

duplicate of #5231


Change CallResult to hold VarUsage vectors.

This change is

crates/cairo-lang-lowering/src/lower/context.rs line 206 at r1 (raw file):
Previously, orizi wrote…
consider

Code snippet:
206 |         VarUsage { var_id: self.variables.new_var(req), location: req.location }
    |                                                   ---             ^^^^^^^^^^^^ value used here after move
    |                                                   |
    |                                                   value moved here


Can i host the service on my own vps?

If it is possible ,how to do it?Thanks for your works.

I'll write up the setup instructions this weekend

Thank you very much!

I'll just write a quick and dirty guide here before writing a proper one on the readme. This leverages the local mode of the program, which is the quick and easy way of running all the services using a single command. This was meant to be used locally on your own computer or for development purposes, however. You still can tweak it a little bit so it can run on a server and accept all connections.

Download the binary file from the release page

wget https://github.com/Frizz925/gbf-proxy/releases/download/v0.1.0/gbf-proxy-linux-amd64 -O gbf-proxy

Start the proxy in local mode which listens on port 8088 on all interfaces

./gbf-proxy local --host <IP_ADDRESS> --port 8088

I'll just write a quick and dirty guide here before writing a proper one on the readme. This leverages the local mode of the program, which is the quick and easy way of running all the services using a single command. This was meant to be used locally on your own computer or for development purposes, however. You still can tweak it a little bit so it can run on a server and accept all connections.

Download the binary file from the release page

wget https://github.com/Frizz925/gbf-proxy/releases/download/v0.1.0/gbf-proxy-linux-amd64 -O gbf-proxy

Start the proxy in local mode which listens on port 8088 on all interfaces

./gbf-proxy local --host <IP_ADDRESS> --port 8088

I have try it on my server,but when i tried the second command it just showed:
-bash: ./gbf-proxy: Permission denied
I use the vultr server runs debian9,no firewall group and i am root of course.
Thanks for your work again.

Execute permission perhaps? Run chmod +x gbf-proxy and try again.

Now runs well thanks.


Oracle never returns

Pressing ctrl+shift+o and selecting something shows a buffer that contains the following:
Running oracle callees command...
It never finishes. The console contains:
Traceback (most recent call last):
  File "goOracle in /Users/anacrolix/Library/Application Support/Sublime Text 3/Installed Packages/GoOracle.sublime-package", line 46, in on_done
  File "goOracle in /Users/anacrolix/Library/Application Support/Sublime Text 3/Installed Packages/GoOracle.sublime-package", line 115, in oracle
TypeError

I got the TypeError, did as @ericaro suggested, and now I get this:
Traceback (most recent call last):
  File "./goOracle.py", line 46, in on_done
  File "./goOracle.py", line 121, in oracle
AttributeError: 'module' object has no attribute 'set_timeout_async'

Sublime text 2, Ubuntu 14.04.

I also see nothing, and your instructions for which file to edit do not contain enough context.
There are no files on my file system with that suffix, therefore I do not know which one to edit.
(Or rather, I have edited the entire (empty) set of them, so I followed your instructions to the letter.)
I have set up .../Packages/GoOracle/User.sublime-settings like so:
{
"env": { "GOPATH": "$HOME/work/gocode", "GOROOT": "$HOME/work/go", "PATH": "$HOME/work/go/bin:$HOME/work/gocode/bin:$PATH"  },
"oracle_scope": [],
"oracle_format": "plain",
"output": "buffer"
}
On the command line I get:
oracle -format=plain -pos=$GOROOT/src/net/http/triv.go:#413 what
/Users/drchase/work/go/src/net/http/triv.go:26.25-26.38: identifier
/Users/drchase/work/go/src/net/http/triv.go:26.20-26.38: selector
/Users/drchase/work/go/src/net/http/triv.go:26.18-26.38: field/method/parameter
/Users/drchase/work/go/src/net/http/triv.go:26.17-26.58: field/method/parameter list
/Users/drchase/work/go/src/net/http/triv.go:26.1-29.1: function declaration
/Users/drchase/work/go/src/net/http/triv.go:7.1-141.1: source file
-: modes: [callers callstack definition describe implements pointsto referrers]
-: srcdir: /Users/drchase/work/go/src
-: import path: net/http
I'm using Sublime Text 3 on a Mac running Mavericks.
I edited User.sublime-settings (the first time) with emacs.
My query to GoOracle in Sublime Text references the exact same file and position (I installed a character counter plugin to get that part right, it was also not working before I installed the character counter plugin).
Thanks for any assistance.

Success!! This is (exactly) what worked for me -- I am working on Go 1.5.
In /Users/drchase/work/go/GoDevel.sublime-project, I put the following,
this may be more than is necessary, but this worked:
{
"folders": [ {
"follow_symlinks": true,
"path":"/Users/drchase/work/go/src"
} ],
"settings": {
"GoOracle": {
"env": {
"GOPATH": "/Users/drchase/GoogleDrive/work/gocode",
"GOROOT": "/Users/drchase/GoogleDrive/work/go",
"PATH": "$GOPATH/bin:$GOROOT/bin:$PATH"
},
"oracle_scope": ["github.com/golang/go"]
}
}
}
#1 GOROOT appears to be necessary
#2 Symbolic links cannot appear in GOPATH or GOROOT; this seems like a bug, or else at least some missing documentation.

@dr2chase tried w/o luck :-(


AVX: vandnpd, vandnps, vblendvpd and vblendvps

_mm256_andnot_pd also generates a single-precision instruction, so I added the intrinsic to #71

So, apparently this intrinsics are already implemented at #90, sorry for that.
I will take this opportunity to ask about masks types. Here and here the masks use the __mm* types and I was assuming that for example this:
fn blendvpd256(a: f64x4, b: f64x4, mask: f64x4) -> f64x4;

should not be written as this:
fn blendvpd256(a: f64x4, b: f64x4, mask: __m256d) -> f64x4;

Is there a reason for the __mm* types in mask?
And again, sorry for not checking the previous PR

Regarding mask types, that's also mentioned in https://github.com/rust-lang-nursery/stdsimd/issues/6

Thanks for the PR @p32blo! As you've noticed though I think these were added in #90 as well so I'm going to close this in favor of that.
Let's continue discussion of the mask types on #6 I think?


DateTime data type in example isn't clear

So I was following the example in this page and it shows a .NET data type of DateTime in the Order class.
Later it shows that sample stored as: "OrderDate": "2014-09-15T23:14:25.7251173Z",
However when I try the same thing, mine is stored as:  "grantDateTimeUtc": "2021-03-01T08:55:00",
I've lost the trailing Z and the fractions of a second, although in my case they are always zeros.
Could the example be made more clear, or am I doing this wrong, somehow?
The documentation specifically states that no formatting is necessary.

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

ID: c256dbf4-122d-1569-c4c3-0e401766c712
Version Independent ID: 747c3f05-167d-2048-6f1b-fa1d7d856f66
Content: Working with dates in Azure Cosmos DB
Content Source: articles/cosmos-db/working-with-dates.md
Service: cosmos-db
Sub-service: cosmosdb-sql
GitHub Login: @SnehaGunda
Microsoft Alias: sngun

How it works makes sense, now that I've dug into it.  It's a little subtle, but the example is using UtcNow extension, which infers a time zone.  My dates didn't have it, so the serializer just decided to turn it into parse-able text.

@nhwilly We are glad this is resolved for you. Please get back to us for any other question.


Improve type code checking in firmware's Messages implementation

This PR resolves #278 by:

Defining a new Util::EnumValues variadic class template which provides a recursive constexpr function to check whether the integer provided as input is the underlying value of one of the enum values provided as a template parameter to the Util::EnumValues template specialization. To use this, specialize Util::EnumValues with an enum type and the enum values from that enum type (e.g. using MyEnumValues = Util::EnumValues<MyEnum, MyEnum::first_value, MyEnum::second_value, MyEnum::third_value>), and then call the Util::EnumValues::includes(integer) method (e.g. if (MyEnumValues::includes(5)) {...}). This way, the comparison of the integer against the list of enum values is statically expanded by the compiler - no need to create and dynamically iterate through a data structure or worry about bounds safety.
Defining some basic unit tests for Util::EnumValues.
Making Protocols::Message take a Util::EnumValues template specialization as a template parameter, so that the Message::parse can call the EnumValues specialization's includes method.
Defining a Application::MessageTypeValues template specialization of Util::EnumValues which must be given all enum values of MessageTypes, and updating the Driver::Serial::Backend::BackendReceiver::BackendMessage template specialization to use Application::MessageTypeValues.
Fixing an off-by-one error in Protocols::Message::parse in checking whether a message type code is within the bounds of pb_message_descriptors

For records-keeping:

This project is licensed under Apache License v2.0 for any software, and Solderpad Hardware License v2.1 for any hardware - do you agree that your contributions to this project will be under these licenses, too? Yes
Were any of these contributions also part of work you did for an employer or a client? No
Does this work include, or is it based on, any third-party work which you did not create? Yes, the design of Util::EnumValues is based on a StackOverflow answer, which is licensed under CC-BY-SA, a license incompatible with our license (credited in a code comment above the declaration of EnumValues). However, my actual implementation of EnumValues is different and I only took inspiration in its approach of using template recursion (which is a standard pattern in template metaprogramming), so I think this should fall under fair use.

@rohanpurohit If you can check that the tests run fine with the latest changes I've made, I think that'll be enough to merge this PR.


ember 2.0 doesn't have EnumerableUtils, it requires ES5 which ships

map/forEach

cc @raytiley

Seems like some tests are still using EnumerableUtils.forEach.

Sorry about this, I already fixed this issue before I saw this PR :(

@poteto NP, i suspect your PR was without test failures :)


dsimp regression: Iff.rfl proofs are not used by dsimp

Prerequisites

[X] Put an X between the brackets on this line if you have done all of the following:

Check that your issue is not already filed.
Reduce the issue to a minimal, self-contained, reproducible test case. Avoid dependencies to mathlib4 or std4.

Description
Users of Lean 3 and mathlib3 are used to seeing dsimp make use of proofs of Iff consisting of Iff.rfl. For example, in Lean 3,
def w : Prop → Prop := fun p, p

@[simp] theorem iff_thm (a : Prop) : w a ↔ a := iff.rfl

example (a : Prop) : w a := by dsimp -- rewrites `w a` to `a`

Whereas in Lean 4,
def w : Prop → Prop | p => p

@[simp] theorem iff_thm : w a ↔ a := Iff.rfl

example : w a := by dsimp -- dsimp made no progress

Ideally, dsimp should be able to rewrite the goal using iff_thm in Lean 4 as well.
Context
This issue first arose in March 2023 on Zulip, where the notion of being able to use Iff.rfl proofs with dsimp in Lean 4 was met with support. No issue was filed at the time.
Presently (October 2023), a different case of dsimp not working as expected for the same reason arose on Zulip. (Note: the linked thread also addresses other issues.)
Steps to Reproduce

Create a @[simp] theorem iff_thm whose proof consists of Iff.rfl
Use dsimp on a goal which includes a match of the lhs or rhs of that lemma

Expected behavior: dsimp rewrites the goal via iff_thm
Actual behavior: dsimp does not use iff_thm
Versions
Lean (version 4.0.0-nightly-2023-08-18, commit 9d05b5f081c2, Release)
macOS Ventura 13.4
Impact
Add :+1: to issues you consider important. If others are impacted by this issue, please ask them to add :+1: to it.

Just to note that this was a lean-community feature that I added in https://github.com/leanprover-community/lean/pull/723 and https://github.com/leanprover-community/lean/pull/736; I would be very happy to see it return!


JOSE Verification Fails with ES256 Key in sd-jwt-example

When attempting to verify an SD-JWT in sd-jwt-example with the jose library, a TypeError is thrown: "Invalid key for this operation, its asymmetricKeyType must be ed25519 or ed448". This occurs even though the key is generated using ES256.generateKeyPair() and the SD-JWT is successfully issued.
To Reproduce

Create a Dockerfile with the following contents:

FROM node:22.9

WORKDIR /app

COPY basic.ts /app/

RUN <<EOF
npm init -y
npm i @sd-jwt/core @sd-jwt/crypto-nodejs @sd-jwt/types jose
EOF

CMD [ "node", "--experimental-strip-types","basic.ts" ]

Create a basic.ts file with the following contents:

import { SDJwtInstance } from '@sd-jwt/core';
import type { DisclosureFrame } from '@sd-jwt/types';
import { ES256, digest, generateSalt } from '@sd-jwt/crypto-nodejs';
import * as jose from 'jose'

(async () => {
  const { privateKey, publicKey } = await ES256.generateKeyPair();
  const signer = await ES256.getSigner(privateKey)
  const verifier = await ES256.getVerifier(publicKey)

  const sdjwt = new SDJwtInstance({
    signer,
    verifier,
    signAlg: 'EdDSA', // Note: signAlg is EdDSA, but ES256 keys are used.
    hasher: digest,
    hashAlg: 'SHA-256',
    saltGenerator: generateSalt,
  });

  // Issuer Define the claims object with the user's information
  const claims = {
    firstname: 'John',
    lastname: 'Doe',
    ssn: '123-45-6789',
    id: '1234',
  };

  // Issuer Define the disclosure frame to specify which claims can be disclosed
  const disclosureFrame: DisclosureFrame<typeof claims> = {
    _sd: ['firstname', 'lastname', 'ssn'],
  };

  const credential = await sdjwt.issue(claims, disclosureFrame);

  console.log("Issued Credential: ",credential);
  console.log("PublicKey: ", publicKey);
  const decodeCredential = await sdjwt.decode(credential);
  console.log("Decode SD-JWT: ",decodeCredential);

  //  The serialized format for the SD-JWT is the concatenation of each
  // part delineated with a single tilde ('~') character as follows:
  // <Issuer-signed JWT>~<Disclosure 1>~<Disclosure 2>~...~<Disclosure N>~
  const issuerSignedJwt = credential.split("~")[0];

  try {
    const joseResult = await jose.jwtVerify(issuerSignedJwt, publicKey);
    console.log("JOSE RESULT: ", joseResult)
  } catch (error) {
    console.error("JOSE Verification Error:", error);
  }

})();

Build and run the Docker container:

docker build -t sd-jwt-test .
docker run --rm sd-jwt-test

Expected behavior
The jose.jwtVerify function should successfully verify the SD-JWT using the provided ES256 public key.
Actual behavior
The jose.jwtVerify function throws a TypeError.
...
Issued Credential:  eyJhbGciOiJFZERTQSJ9.eyJpZCI6IjEyMzQiLCJfc2QiOlsiTzVpNkpDOGx4M296em1hdUZIQ3lFaTQ1ekdkTTdjOHVXaGF3SlFZODlfTSIsIlBlcXRkSmIxbl9VVTl1MDlQVmZRak9tMndzbzBOamEyTEx2R2p5X1NLMk0iLCJfdTRDaDAtbFpQaXAyMVFkOXQyRkVNVHdsdWJMLU9hTFhZT1k1dU5BUjA0Il0sIl9zZF9hbGciOiJTSEEtMjU2In0.Eo5PR6thdfUArq9sro-086v8oFHU_0Dir0mt2fGQtEh_ppLk0cIrX4RyKybv3yh83JNMVmeNd2tIfN5VT3zuWA~WyJmZDAyNDNhODM0MzNiM2M5IiwiZmlyc3RuYW1lIiwiSm9obiJd~WyJjY2M2NTk0ODMyMGMwYmZiIiwibGFzdG5hbWUiLCJEb2UiXQ~WyJkOWY4OTU4YTIwMDg0YWY3Iiwic3NuIiwiMTIzLTQ1LTY3ODkiXQ~
PublicKey:  {
  key_ops: [ 'verify' ],
  ext: true,
  kty: 'EC',
  x: 'n7TtUwnB_ZhxEsvQGPbupmpFWcAmSiTtax92ruTf1ZY',
  y: 'Pg4__e5MUr1na5bvAKRMspzqtQE_JLyzg1jCDAAkZjA',
  crv: 'P-256'
}
Decode SD-JWT:  _SDJwt {
  jwt: _Jwt {
    header: { alg: 'EdDSA' },
    payload: { id: '1234', _sd: [Array], _sd_alg: 'SHA-256' },
    signature: 'Eo5PR6thdfUArq9sro-086v8oFHU_0Dir0mt2fGQtEh_ppLk0cIrX4RyKybv3yh83JNMVmeNd2tIfN5VT3zuWA',
    encoded: 'eyJhbGciOiJFZERTQSJ9.eyJpZCI6IjEyMzQiLCJfc2QiOlsiTzVpNkpDOGx4M296em1hdUZIQ3lFaTQ1ekdkTTdjOHVXaGF3SlFZODlfTSIsIlBlcXRkSmIxbl9VVTl1MDlQVmZRak9tMndzbzBOamEyTEx2R2p5X1NLMk0iLCJfdTRDaDAtbFpQaXAyMVFkOXQyRkVNVHdsdWJMLU9hTFhZT1k1dU5BUjA0Il0sIl9zZF9hbGciOiJTSEEtMjU2In0.Eo5PR6thdfUArq9sro-086v8oFHU_0Dir0mt2fGQtEh_ppLk0cIrX4RyKybv3yh83JNMVmeNd2tIfN5VT3zuWA'
  },
  disclosures: [
    _Disclosure {
      _digest: 'PeqtdJb1n_UU9u09PVfQjOm2wso0Nja2LLvGjy_SK2M',
      _encoded: 'WyJmZDAyNDNhODM0MzNiM2M5IiwiZmlyc3RuYW1lIiwiSm9obiJd',
      salt: 'fd0243a83433b3c9',
      key: 'firstname',
      value: 'John'
    },
    _Disclosure {
      _digest: '_u4Ch0-lZPip21Qd9t2FEMTwlubL-OaLXYOY5uNAR04',
      _encoded: 'WyJjY2M2NTk0ODMyMGMwYmZiIiwibGFzdG5hbWUiLCJEb2UiXQ',
      salt: 'ccc65948320c0bfb',
      key: 'lastname',
      value: 'Doe'
    },
    _Disclosure {
      _digest: 'O5i6JC8lx3ozzmauFHCyEi45zGdM7c8uWhawJQY89_M',
      _encoded: 'WyJkOWY4OTU4YTIwMDg0YWY3Iiwic3NuIiwiMTIzLTQ1LTY3ODkiXQ',
      salt: 'd9f8958a20084af7',
      key: 'ssn',
      value: '123-45-6789'
    }
  ],
  kbJwt: undefined
}
JOSE Verification Error: TypeError: Invalid key for this operation, its asymmetricKeyType must be ed25519 or ed448
    at keyForCrypto (file:///app/node_modules/jose/dist/node/esm/runtime/node_key.js:47:23)
    at verify (file:///app/node_modules/jose/dist/node/esm/runtime/verify.js:21:22)
    at flattenedVerify (file:///app/node_modules/jose/dist/node/esm/jws/flattened/verify.js:92:28)
    at compactVerify (file:///app/node_modules/jose/dist/node/esm/jws/compact/verify.js:15:28)
    at Module.jwtVerify (file:///app/node_modules/jose/dist/node/esm/jwt/verify.js:5:28)
    at file:///app/basic.ts:49:35

Environment

Node.js v22.9
@sd-jwt/* (latest versions)
jose (latest version)

Additional context
The issue seems to stem from a mismatch between the specified signing algorithm (signAlg: 'EdDSA') and the key type (ES256).  While the SD-JWT library may be generating a valid JWT with an ES256 signature despite the signAlg setting, the jose library is expecting an EdDSA key for verification because of that signAlg value.  This suggests a potential bug either in the SD-JWT library's handling of the signAlg option, or a misconfiguration in the provided example code. Correcting the signAlg to ES256 should resolve the issue.
https://github.com/openwallet-foundation-labs/sd-jwt-js/blob/96e76a9d553bff34274b5ad243d0154cd220061b/examples/sd-jwt-example/all.ts#L12

Hi @y12studio Thanks for reporting.
I understood that there was a problem with the JWT signed part of SD-JWT with our crypto-nodejs not being verified by jose. Right?
It maybe a problem of our crypto-nodejs package. I'll take a look and work on the fix :)

Oh I got it.
as you pointed out:
const sdjwt = new SDJwtInstance({
    signer,
    verifier,
    signAlg: 'EdDSA', // Note: signAlg is EdDSA, but ES256 keys are used.
    hasher: digest,
    hashAlg: 'SHA-256',
    saltGenerator: generateSalt,
  });

We're using EdDSA in header but signed with ES256. I'll change the example and create PR


Bracketed choices which don't have content before their brackets error when a subsequently nested third-level choice is encountered

This one's SUPER specific, but:

-> content
== content

*	Some choice
	blah blah
	blah blah blah
*	*	[This is the killer!] Text can be here though, just not on the left.
		Blah blah
		Something something
*	*	*	Encountering this choice causes an error.
-	Weave...
-> DONE

The error is "Stack is empty! No top()!" from _container.top() on line 1176 of runner_impl.cpp:
			case Command::END_CONTAINER_MARKER:
			{
				container_t index = read<container_t>();
				inkAssert(_container.top().id == index, "Leaving container we are not in!");

				// Move up out of the current container
				_container.pop();

Unit test here. This occurs on MSVC regardless of configuration (Release or Debug).
I tried it on #65, but it's still broken there, so this is unrelated to #63.
Note that it is required to be in a knot; it doesn't occur at the top level.

Thank you for catching it. There was a shortcut in the jump routine which resulted in errors. It is disabled for now. (also part of #65)


Setting scheduler

I just noticed my closure are executed on the main thread.
Is there a way to set the default scheduler queue?

you can .init the APIHander with .Settings and set the default queue
APIHandler(with: .init(delay: ClosedRange<Double>, queues: APIHandler.Settings.Queues, device: Device?, session: URLSession))

Amazing! thanks


Update visual-studio-tools-for-docker.md with link to /visualstudio/containers hub page

Add link to new containers hub page.

Awesome contribution, @ghogen! I had no idea this hub page existed.

@scottaddie Just created that page recently. With some help from John Anderson.


Analyzer reports non_constant_identifier_names on keys that contain underscores

Our keys follow a hierarchy and we use underscores as a delimiter:
"app_emptyState_retry": "Try again",
"app_error_conflict": "Your changes conflict with changes someone else did at the same time.",
"app_error_noConnection": "No connection to the server.",
"app_error_noPermission": "You don't have the permission to do that.",
"app_error_rateLimit": "Too many requests. Try again in {timeToWait}.",
…

Thus, the generated code correctly contains getters named app_emptyState_retry etc.
Because we enabled pedantic analysis options in our project the analyzer complains about naming non-constant identifiers using lowerCamelCase. So, we get hundreds of linter errors once we generate the translation file.
Excluding files from the Dart analyzer seemingly won't work anytime soon (https://github.com/dart-lang/sdk/issues/25551), so would it be possible to add the following comment at the top of the file?
// ignore_for_file: non_constant_identifier_names

I'd be happy to file the PR.

Any updates on this?


"Secrets" section still erroneously points to AAD Pod Identity

The "Secrets management" section still points to AAD Pod Identity.
Microsoft already does not recommend using this as it's being replaced by Azure AD Workload Identity :
https://azure.github.io/azure-workload-identity/docs/
The document should reflect that.

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

ID: c5e2e444-d6b9-962e-56d4-8d1f3508ba9e
Version Independent ID: 061ea6aa-353b-a98d-cbf6-639209a5fd1b
Content: Microservices architecture on AKS - Azure Architecture Center
Content Source: docs/reference-architectures/containers/aks-microservices/aks-microservices.yml
Service: architecture-center
Sub-service: reference-architecture
GitHub Login: @EdPrice-MSFT
Microsoft Alias: pnp

Thank you for your feedback! We have assigned this issue to the author to review further and take the next course of action.

Hi - any updates on this?

This should be addressed in the latest updates to the article.


Missing option to pass full row object to custom cell component

Previously (in ng2-smart-table) it was possible to receive full row data object just by adding value variable in custom component. Now, it is not rendering correctly + it seems like it is impossible to get full row data in the custom component, only the value of one column.

Yes, the behavior changed with release 3.0. Probably something we might want to add retrospectively to the migration page.


Use an exponential representation for interface/inspector/default_float_step

Deleted remote branch by mistake, reopened #60230. I'm very sorry.
Previously, step was set to 0, making it impossible to drag to change the value.
It might be better to use a base 10 index here. For example -3 means 0.001, -5 means 0.00001.

Use exponential representation for this property instead, increase the range of precision that can be used.

Before
After

Property
interface/inspector/default_float_step
interface/inspector/default_float_step_exponent

Hint_range
(0, 1, 0.001) [hard-coded]
(-14, 0, 1) [hard-coded]

Brief introduction
The property is limited by its hint range step  , valid value cannot be less than 0.001, accurate to 3 decimals.
10^E,  accurate to E decimals.

Hey! Thanks for contributing. We discussed this in today's PR meeting and didn't reach consensus on it; most weren't convinced this would be clearer to Godot's userbase, especially beginners.
If you still strongly think this is worth consideration, you should open a proposal so we can gauge the support for this change.
Thanks for contributing :)


[AutoDiff] TF-277: Fix type-remapping crash.

Previously, getOpASTType was used in visitLoadInst and visitStoreInst to
remap SIL types that were converted to canonical types. However, this led to an
assertion failure regarding remapping lowered types.
Now, getOpType is used to remap SIL types, and the remapped types are then
converted to canonical types.
Resolves TF-277.

Thanks to @pschuh for finding the fix in lib/SIL/InstructionUtils.cpp.

@swift-ci Please test tensorflow

@swift-ci please test tensorflow

@swift-ci please test tensorflow

@swift-ci please test tensorflow

@swift-ci please test tensorflow

@swift-ci please test tensorflow

@swift-ci please test tensorflow

@swift-ci please test tensorflow

@swift-ci please test tensorflow

@swift-ci please test tensorflow

@swift-ci please test tensorflow

@swift-ci please test tensorflow

@swift-ci please test tensorflow Linux

@swift-ci please test tensorflow

@swift-ci please test tensorflow

@swift-ci please test tensorflow


Handling adhika masas for festivals

Need to expand the toml description to include a tag for adhika masas
There are festivals that are celebrated

only in adhika masa
in adhika masa alone, if adhika masa exists or in nija masa otherwise
in both adhika and nija masas
only in nija masa

The above logic should be supported by the toml and encode in the decision making.

Duplicate or related to https://github.com/jyotisham/jyotisha/issues/80 ?

Good point. I had forgotten #80. And #80 was somewhat simpler, as it may not permit things like point 2 above... I think this should supersede #80.

This would require changing the toml schema, right? Thoughts?

Could add a field under timing:
adhika_maasa_handling = "adhika_only"
adhika_maasa_handling = "adhika_if_exists"
adhika_maasa_handling = "adhika_and_nija"
adhika_maasa_handling = "nija_only"

nija_only

@vvasuki this has been truly challenging, partly because I haven't fully understood the festival calculation perfectly. Can you eyeball the last few commits, and suggest ways to improve? What would be the best place to implement the handling?

While loading .toml files, we could process and add additional festivals  (I tried it and commented it out)
Modify get_possibly_relevant_fests() as I have mostly done here
Modify _should_assign_festival() as I have done here - I seem to not be able to get around this exception check and had to hack together more exception handling here.

What do you think is the best way forward? I should have really started this in a separate branch -- totally underestimated the difficulty of the problem. All tests pass currently (but I think some adhika maasa festivals like ArambhaH and samApanam are not assigned)

The tests were failing on my computer. Fixed those, simplified the code, added comments. You should be set for further changes.
You were roughly on the right track - get_possibly_relevant_fests needed to be modified. Now, get_possibly_relevant_fests was not properly fixed/ tested; so you needed to add ~80 lines downstream in apply_month_anga_events to handle edge cases that slipped through (removed all that junk).
Things I noted:

If you insert 80 lines of code into a (previously short) function, you're severely impeding readability and that leads to errors you won't notice. If necessary, add and call new functions.
No unit tests. If you had written a thorough unit test (<- still doesn't exist) for get_possibly_relevant_fests, you would've had much smoother sailing.

Good luck forward!


Adds GTM Topology Endpoint

Fixes #875
Problem:
GTM Topology Endpoint was not in SDK.
Analysis:
Adds GTM Topology endpoint to SDK, adds custom create method to accomodate for defects in 11.5.4 and 11.6.1 Final. Adds 'name' property checking to facilitate special name syntax used for GTM topology objects
Tests:
Functional
Unit
Flake8

Related to issue:
#797
Merge First


Show Run Start Time

Currently, only the duration is shown. The time when the run was triggered should also be present.

This is actually shown already when hovering over the time taken, wrongfully made issue.


Add Opacity shortcuts

Hi,
Will be great if you add shortcuts to control the opacity, maybe using the numbers.
Thanks!

Feature added on pull request https://github.com/JadenGeller/Helium/pull/40

You can just add a shortcut in keyboard preferences.

Closed by #40

Already testet... Works perfectly!
Thanks