staticHtml() function like text() function

I've a case where all i need is to render the given html code which will be rendered exactly like the text() function does but it will be rendered as html not as text.
For example instead of using the text() function, i will use the staticHtml() function like:
staticHtml('<i class="fa fa-home"></i>');

The point here is exactly the same as the static attributes but html tags instead.

Internally we have a method that looks something like
function printSanitizedHtml(html:string) {
const el = incrementaldom.elementOpen('html-blob');
el.innerHTML = content;
incrementaldom.skip()
incrementaldom.elementClose('html-blob');
}

Internally we have a method that looks something like

Thank you sir, you saved my day <3
I think this should be written in the documentation.

Added some documentation here: https://google.github.io/incremental-dom/#rendering-html-blobs with a slight modification to the approach outlined above.


nullif incorrectly calculates null_count, sometimes panics with substraction overflow error

Describe the bug
nullif(left, right) incorrectly calculates null_count for the result array, whenever left doesn't have a null_buffer and has len % 64 == 0. It can even panic, if there are less than 64 true values in right.
To Reproduce
    let n = 64;
    let left = Int32Array::from((0..n as i32).into_iter().collect::<Vec<_>>());
    let right = BooleanArray::from((0..n).into_iter().map(|_| None).collect::<Vec<_>>());
    arrow_select::nullif::nullif(&left, &right);

Expected behavior
It works.
Actual behavior
It panics with 'attempt to subtract with overflow' at this line:
https://github.com/apache/arrow-rs/blob/796b670338ce33806a39777ea18cf6fae8fa7ee4/arrow-select/src/nullif.rs#L107
Additional context
The problem evaded fixes #3034 and #3263, which were incomplete. The wrong calculation occurs in these lines:
https://github.com/apache/arrow-rs/blob/796b670338ce33806a39777ea18cf6fae8fa7ee4/arrow-select/src/nullif.rs#L81-L90
The reason it is wrong is the un-intuitive, if not to say wrong, behavior of bitwise_unary_op_helper() and friends. They're calling op() unconditionally on the remainder bits, even if there are none:
https://github.com/apache/arrow-rs/blob/3a90654f4cb98ac7fe278991a6cbc11384664e2e/arrow-buffer/src/buffer/ops.rs#L119-L123
It doesn't make a difference for the produced output buffer, because it is then just extended with slice of 0 bytes, i.e. remains unaffected. But it does matter for FnMut closures with side effects, such as the one found in nullif, which, as a result of this behavior, adds an excess of 64 to valid_count, when there are no remainder bits, i.e. bit length is a multiple of 64.
The quick fix is to do valid_count -= 64 - remainder_len; in nullif() unconditionally, i.e. just remove the if remainder_len != 0 { condition around it. It was clearly written in assumption, that bitwise_unary_op_helper() doesn't call op() in excess, when there are no remainder bits.
A better fix could have been to avoid making excess op() calls in bitwise_unary_op_helper() and friends, but since they're public, it could lead to bugs in external consumers, which might have come to rely on this weird behavior.
In any case, I suggest at least checking whether other usages of bitwise_unary_op_helper() and friends
in arrow-rs make the same incorrect assumption. Temporarily changing the type of op parameter from FnMut to Fn and looking at the compilation error fallout should point out all suspicious places.

Just in case, here's the code that I used to validate that the quick fix works:

    std::panic::set_hook(Box::new(|_info| { /* silence panics */ }));

    for n in 0..=128+64 {
        let left = Int32Array::from((0..n as i32).into_iter().collect::<Vec<_>>());

        for somes in 0..=n {
            for trues in 0..=somes {
                let right = BooleanArray::from((0..n).into_iter().map(|i| {
                    Some(i < trues).filter(|_| i < somes)
                }).collect::<Vec<_>>());

                let ok = std::panic::catch_unwind(|| {
                    let arr = arrow_select::nullif::nullif(&left, &right).unwrap();
                    let arr: &Int32Array = arrow_array::cast::as_primitive_array(&arr);
                    arrow_array::Array::data(arr).validate_full().unwrap();
                }).is_ok();

                if !ok {
                    println!("{n} {somes} {trues}");
                }
            }
        }
    }

Thank you for the detailed report, makes sense to me. The change to FnMut was relatively recent so I think this should be the only impacted location, but I will verify.
Bit embarrassing this kernel has taken quite so many iterations to fix 😅

A potential bug I found whilst testing this, dating from 2020 - https://github.com/apache/arrow-rs/issues/3589

label_issue.py automatically added labels {'arrow'} from #3590


Implement delayBy operator

Spec: https://material-motion.github.io/material-motion/starmap/specifications/operators/delayBy

🎊 My diff is ready for review at http://codereview.cc/D3026


The contents of the folder are not displayed when the folder is found via the plugin "search"

Hello, can you answer please: can I make that after searching, found folders show their contents? At the moment, only the found folders are displayed without the possibility of viewing the content in them.

Set this to true:
https://www.jstree.com/api/#/?q=show_only_matches_chi&f=$.jstree.defaults.search.show_only_matches_children

Thank you very much for your help! You helped me a lot and it's not the first time!


V3 not working with NestJS

I'm running into an issue where is appears the serverAdapter isn't handling req as expected — I just simply get a 404. I setup a basic example Stackblitz => https://stackblitz.com/edit/nestjs-starter-demo-gvfxkh
I was using v1.5.1 before - here is was my working main.ts
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { router } from 'bull-board';

async function bootstrap() {
  const app = await NestFactory.create(AppModule);
  app.use('/admin/queues', router);
  await app.listen(3000);
}
bootstrap();

I migrated to v3.3.0 yesterday and have no very little luck with getting ExpressAdapter working correctly. Here is my current non-working main.ts
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { ExpressAdapter } from '@bull-board/express';

async function bootstrap() {
  const app = await NestFactory.create(AppModule);

  const serverAdapter = new ExpressAdapter();
  serverAdapter.setBasePath('/admin/queues');
  app.use('/admin/queues', serverAdapter.getRouter());

  await app.listen(3000);
}
bootstrap();

Any help would be awesome!

You forgot to initiate the bullBoard it self :]
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { ExpressAdapter } from '@bull-board/express';
import { createBullBoard } from '@bull-board/api';
import { BullMQAdapter } from '@bull-board/api/bullMQAdapter';
import QueueMQ from 'bullmq';

async function bootstrap() {
  const app = await NestFactory.create(AppModule);

  const serverAdapter = new ExpressAdapter();
  serverAdapter.setBasePath('/admin/queues');

  const queueMQ = new QueueMQ('queueMQName')

  createBullBoard({
    queues: [
      new BullMQAdapter(queueMQ),
    ],
    serverAdapter
  });

  app.use('/admin/queues', serverAdapter.getRouter());

  await app.listen(3000);
}
bootstrap();

@felixmosh thanks for the quick reply. I think I might be misunderstanding how to setup / init createBullBoard.
Currently I have 7 different queues — 3 are in a controller and the other 4 are in services...
My setup in v1.5.1 was
import { InjectQueue } from '@nestjs/bull';
import { Body, Controller, Get, Injectable, Logger, Param, Post, Put } from '@nestjs/common';
import { Queue } from 'bull';
import { setQueues, BullAdapter } from 'bull-board';

@Controller('base')
export class baseController {

    constructor(
        @InjectQueue('matches') public scoreQueue: Queue,
        @InjectQueue('opponents') public opponentQueue: Queue,
        @InjectQueue('progress') public progressQueue: Queue,
    ) {
        setQueues([
            new BullAdapter(this.scoreQueue),
            new BullAdapter(this.opponentQueue),
            new BullAdapter(this.progressQueue)
        ]);

}

Based on what is in the examples for v3.3.0 I just changed it to this
import { Body, Controller, Get, Injectable, Logger, Param, Post, Put } from '@nestjs/common';
import { Queue } from 'bull';
import { createBullBoard } from '@bull-board/api';
import { ExpressAdapter } from '@bull-board/express';
import { BullAdapter } from '@bull-board/api/bullAdapter';

@Controller('base')
export class baseController {
    public serverAdapter = new ExpressAdapter();

    constructor(
        @InjectQueue('matches') public scoreQueue: Queue,
        @InjectQueue('opponents') public opponentQueue: Queue,
        @InjectQueue('progress') public progressQueue: Queue,
    ) {
        createBullBoard({
            queues: [
                new BullAdapter(this.scoreQueue),
                new BullAdapter(this.opponentQueue),
                new BullAdapter(this.progressQueue),
            ],
            serverAdapter: this.serverAdapter
        });

}

Correct me if I'm wrong here but I want to createBullBoard in my main.ts then push my queues into that?

You are correct :]

Ok i'm completely stubbed on how to correctly access the queue...
There is setQueues on the ExpressAdapter but that doesn't appear to be what I want.
There is addQueue on createBullBoard but I have already init that but its in my main.ts which is boostrapped in...
I'm have to be missing something super simple here...

Can you access your queues in the main.ts file? If so, create an instance of serverAdapter call createBullBoard with it & your queues, if they are not accessible there, createBullBoard returns addQueue method like previous versions did, share it somehow.
Hope it helps.
If not, prepare a simple stackblitz, and I will try to help you.

Did you managed to solve this?

@felixmosh sorry busy weekend I'll kick that around today and let you know

@felixmosh finally got some time to flush this out, let me know what you think.

Created a class to act as a pool for my queues

import { BullAdapter } from '@bull-board/api/bullAdapter';
import { BaseAdapter } from '@bull-board/api/dist/src/queueAdapters/base';
import { Injectable } from '@nestjs/common';
import { Queue } from 'bull';

@Injectable()
export class BullBoardQueue { }

export const queuePool: Set<Queue> = new Set<Queue>();

export const getBullBoardQueues = (): BaseAdapter[] => {
    const bullBoardQueues = [...queuePool].reduce((acc: BaseAdapter[], val) => {
        acc.push(new BullAdapter(val))
        return acc
    }, []);

    return bullBoardQueues
}

In my main.ts I get my queue pool and loop over it and call addQueue

import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { ExpressAdapter } from '@bull-board/express';
import { createBullBoard } from '@bull-board/api';
import { getBullBoardQueues } from './bull-board-queue';
import { BaseAdapter } from '@bull-board/api/dist/src/queueAdapters/base';

async function bootstrap() {
  const app = await NestFactory.create(AppModule);

  const serverAdapter = new ExpressAdapter();
    const queues = getBullBoardQueues();

    serverAdapter.setBasePath('/admin/queues');
    app.use('/admin/queues', serverAdapter.getRouter());

    const { addQueue } = createBullBoard({
        queues: [],
        serverAdapter
    });

    queues.forEach((queue: BaseAdapter) => {
        addQueue(queue);
    });

  await app.listen(3000);
}
bootstrap();

I just import my class and add my queue pool => queuePool.add(updateQueue) — not perfect but gets the job done

It looks good to me 👍

@Module({
  imports: [
    BullModule.registerQueue({
      name: 'queue1',
    }),
  ],
})
export class BullBoardModule implements NestModule {
  @Inject(getQueueToken('queue1'))
  private readonly queue: Queue

  configure(consumer: MiddlewareConsumer) {
    const serverAdapter = new ExpressAdapter()
    const { addQueue, removeQueue, setQueues, replaceQueues } = createBullBoard(
      { queues: [new BullAdapter(this.queue)], serverAdapter },
    )
    serverAdapter.setBasePath('/api/admin/queues')
    consumer.apply(serverAdapter.getRouter()).forRoutes('/admin/queues')
  }
}

This should work too.

@asomethings
Property 'setBasePath' does not exist on type 'ExpressAdapter'.
Property 'getRouter' does not exist on type 'ExpressAdapter'.

@Module({
  imports: [
    BullModule.registerQueue({
      name: 'queue1',
    }),
  ],
})
export class BullBoardModule implements NestModule {
  @Inject(getQueueToken('queue1'))
  private readonly queue: Queue

  configure(consumer: MiddlewareConsumer) {
    const serverAdapter = new ExpressAdapter()
    const { addQueue, removeQueue, setQueues, replaceQueues } = createBullBoard(
      { queues: [new BullAdapter(this.queue)], serverAdapter },
    )
    serverAdapter.setBasePath('/api/admin/queues')
    consumer.apply(serverAdapter.getRouter()).forRoutes('/admin/queues')
  }
}

This should work too.

You tried to add basic auth on this aprocah on nest js?

I couldn't get the above examples to work with my setup, so I thought I'd paste what I got to work in case anyone else is in the same boat.
My versions:
$ egrep "nestjs|bull|bull-board" package.json
    "@bull-board/api": "^3.7.0",
    "@bull-board/express": "^3.7.0",
    "@nestjs/bull": "^0.4.2",
    "@nestjs/common": "^8.1.2",
    "@nestjs/config": "^1.0.2",
    "@nestjs/core": "^8.1.2",
    "@nestjs/event-emitter": "^1.0.0",
    "@nestjs/jwt": "^8.0.0",
    "@nestjs/passport": "^8.0.1",
    "@nestjs/platform-express": "^8.1.2",
    "@nestjs/typeorm": "^8.0.2",
    "bull": "^3.3",
    "bullmq": "^1.51.1",
    "@nestjs/cli": "^8.1.4",
    "@nestjs/schematics": "^8.0.4",
    "@nestjs/testing": "^8.1.2",
    "@types/bull": "^3.15.1",

My Controller:
import { AuScope } from '@au/dtos';
import {
  Request,
  Response,
  All,
  Controller,
  Next,
  UseGuards,
  BadRequestException,
} from '@nestjs/common';
import express from 'express';
import { AuthGuard } from '../auth/auth.guard';
import { Scope } from '../auth/scope.decorator';
import { QueuesManagerService } from './queues-manager.service';

export const bullBoardPath = 'api/queues/admin';

@Controller(bullBoardPath)
@Scope(AuScope.QueuesAdmin)
@UseGuards(AuthGuard)
export class BullBoardController {
  constructor(private readonly service: QueuesManagerService) {}

  @All('*')
  admin(
    @Request() req: express.Request,
    @Response() res: express.Response,
    @Next() next: express.NextFunction,
  ) {
    const router = this.service.router;
    if (!router) {
      throw new BadRequestException('router not ready'); // Shouldn't happen.
    }

    const entryPointPath = '/' + bullBoardPath + '/';
    req.url = req.url.replace(entryPointPath, '/');

    router(req, res, next);
  }
}

And the relevant part of QueuesManagerService, which initializes bull-board.  Note that initBullBoard is called as part of onModuleInit:
  readonly initBullBoard = () => {
    const funcPrefix = `${prefix}.initBullBoard: `;
    this.logger.log(`${funcPrefix}registering queues with UI`);
    const queues = this.queues.map((_) => new BullAdapter(_));

    const serverAdapter = new ExpressAdapter();
    const basePath = '/' + bullBoardPath;
    serverAdapter.setBasePath(basePath);

    createBullBoard({
      queues,
      serverAdapter,
    });

    this.router = serverAdapter.getRouter() as express.Express;
    this.logger.log(`${funcPrefix}registered queues with UI`);
  };

The odd thing is that serverAdapter is told the base path, and prefixes all the client requests with the base path, as appropriate.  However, the express router that it returns does not use the given prefix to set its routes.  Without the req.url = req.url.replace(entryPointPath, '/'); line, I was getting 404s since the router didn't match the path - it needs '/' instead of '/api/queues/admin/'.

For basic auth I use the following code in my main.ts
`import { NestFactory } from '@nestjs/core';
import * as passport from 'passport';
import { BasicStrategy } from 'passport-http';
import { BullMonitorBoardModule } from './bull-monitor-board.module';
async function bootstrap() {
const bullBoardUserName = process.env.BULL_BOARD_USERNAME;
const bullBoardPassword = process.env.BULL_BOARD_PASSWORD;
const app = await NestFactory.create(BullMonitorBoardModule);
passport.use(
new BasicStrategy((username, password, done) => {
if (username === bullBoardUserName && password === bullBoardPassword) {
done(null, true);
} else {
done(null, false);
}
}),
);
const port = parseInt(process.env.PORT) || 8899;
await app
.use(
'/admin/queues',
passport.authenticate('basic', {
session: false,
}),
)
.listen(port);
}
bootstrap();
`

basePath

this one works for me on nestjs v9

@felixmosh finally got some time to flush this out, let me know what you think.

Created a class to act as a pool for my queues

import { BullAdapter } from '@bull-board/api/bullAdapter';
import { BaseAdapter } from '@bull-board/api/dist/src/queueAdapters/base';
import { Injectable } from '@nestjs/common';
import { Queue } from 'bull';

@Injectable()
export class BullBoardQueue { }

export const queuePool: Set<Queue> = new Set<Queue>();

export const getBullBoardQueues = (): BaseAdapter[] => {
    const bullBoardQueues = [...queuePool].reduce((acc: BaseAdapter[], val) => {
        acc.push(new BullAdapter(val))
        return acc
    }, []);

    return bullBoardQueues
}

In my main.ts I get my queue pool and loop over it and call addQueue

import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { ExpressAdapter } from '@bull-board/express';
import { createBullBoard } from '@bull-board/api';
import { getBullBoardQueues } from './bull-board-queue';
import { BaseAdapter } from '@bull-board/api/dist/src/queueAdapters/base';

async function bootstrap() {
  const app = await NestFactory.create(AppModule);

  const serverAdapter = new ExpressAdapter();
    const queues = getBullBoardQueues();

    serverAdapter.setBasePath('/admin/queues');
    app.use('/admin/queues', serverAdapter.getRouter());

    const { addQueue } = createBullBoard({
        queues: [],
        serverAdapter
    });

    queues.forEach((queue: BaseAdapter) => {
        addQueue(queue);
    });

  await app.listen(3000);
}
bootstrap();

I just import my class and add my queue pool => queuePool.add(updateQueue) — not perfect but gets the job done. Thanks for the help!

I spend the day trying to 'share' addQueue from main.ts to my queueService. A good solution was to use the HttpAdapterHost  of my AppModule
`
@Injectable()
export class QueueService {
constructor(
	@InjectQueue(QueueEnums.QueueName) private readonly _queue: Queue,
	private adapterHost: HttpAdapterHost
) {
	const serverAdapter = new ExpressAdapter()
	serverAdapter.setBasePath('/admin/queues')
	createBullBoard({
		queues: [new BullAdapter(_queue)],
		serverAdapter: serverAdapter
	})
	this.adapterHost.httpAdapter.use('/admin/queues', serverAdapter.getRouter())
}

`

And some more solutions.
I decided that bootstrap isn't a good place for registering routes and middlewares.
At the start, I created a class called as BullBoardMiddleware, but isn't implemented NestMiddleware:
@Injectable()
export class BullBoardMiddleware {
  static readonly ROUTE = '/admin/bb';

  readonly serverAdapter = new ExpressAdapter();

  constructor(@InjectQueue(OFFLINE_LOGS_QUEUE) private readonly queue: Queue) {
    this.serverAdapter.setBasePath(BullBoardMiddleware.ROUTE);
    createBullBoard({
      queues: [new BullAdapter(this.queue)],
      serverAdapter: this.serverAdapter,
    });
  }
}

At the next step, I registered the router in the AppModule:
export class AppModule implements NestModule {
  constructor(private readonly bullBoard: BullBoardMiddleware) {}

  public configure(consumer: MiddlewareConsumer): void {
    consumer
      .apply(this.bullBoard.serverAdapter.getRouter())
      .forRoutes(BullBoardMiddleware.ROUTE);
  }
}

In finally (it's optional if you don't use setGlobalPrefix), I excluded the BullBoard route from setGlobalPrefix in the bootstrap:
app.setGlobalPrefix('api', { exclude: [BullBoardMiddleware.ROUTE] })

If you have multiple queues and the queue registration is spread throughout your app, you can do something like this:
Global BullQueueModule with 1 service:
@Global()
@Module({
  providers: [BullQueueService],
  exports: [BullQueueService],
})
export class BullQueueModule {}

BullQueueService:
import { Injectable, OnModuleInit } from '@nestjs/common';
import { HttpAdapterHost } from '@nestjs/core';
import { Queue } from 'bull';

import * as basicAuth from 'express-basic-auth';
import { ExpressAdapter } from '@bull-board/express';
import { createBullBoard } from '@bull-board/api';
import { BullAdapter } from '@bull-board/api/bullAdapter';

@Injectable()
export class BullQueueService implements OnModuleInit {
  private readonly queues = new Set<Queue>();

  constructor(private readonly adapterHost: HttpAdapterHost) {}

  addQueue(queue: any) {
    this.queues.add(queue);
  }

  onModuleInit() {
    const serverAdapter = new ExpressAdapter();
    serverAdapter.setBasePath('/admin/queues');

    createBullBoard({
      queues: Array.from(this.queues).map((queue) => new BullAdapter(queue)),
      serverAdapter,
    });

    this.adapterHost.httpAdapter.use(
      '/admin/queues',
      serverAdapter.getRouter(),
    );
    this.adapterHost.httpAdapter.use(
      '/admin/queues',
      basicAuth({
        challenge: true,
        users: { user: 'pass' },
      }),
    );
  }
}

Modules that add their queues to bull queue service:
@Module({
  imports: [
    BullModule.registerQueue({
      name: VIDEO_PROCESSOR_QUEUE,
    }),
  ],
  providers: [VideoProcessorService, VideoProcessorConsumer],
  exports: [VideoProcessorService],
})
export class VideoProcessorModule {
  constructor(
    @InjectQueue(VIDEO_PROCESSOR_QUEUE)
    public readonly videoProcessorQueue: Queue,
    public readonly bullQueueService: BullQueueService,
  ) {
    this.bullQueueService.addQueue(this.videoProcessorQueue);
  }
}

@zenstok createBullBoard function returns an object with add, replace, remove function to add queues dynamically, it may help to add queues "on the fly"

I used @asomethings's solution and added a BasicAuth middleware. My goal was to have everything related to queues in a single module and not spread out in main/bootstrap.ts.
import {
  DynamicModule,
  MiddlewareConsumer,
  Module,
  NestMiddleware,
  NestModule,
} from '@nestjs/common';
import { BullModule, InjectQueue } from '@nestjs/bullmq';
import { Queue } from 'bullmq';
import { createBullBoard } from '@bull-board/api';
import { BullAdapter } from '@bull-board/api/bullAdapter';
import { ExpressAdapter } from '@bull-board/express';

import { TestProcessor } from './test.processor';
import { NextFunction, Request, Response } from 'express';

class BasicAuthMiddleware implements NestMiddleware {
  private readonly username = 'user';
  private readonly password = 'password';
  private readonly encodedCreds = Buffer.from(
    this.username + ':' + this.password,
  ).toString('base64');

  use(req: Request, res: Response, next: NextFunction) {
    const reqCreds = req.get('authorization')?.split('Basic ')?.[1] ?? null;
    console.log(reqCreds, this.encodedCreds);

    if (!reqCreds || reqCreds !== this.encodedCreds) {
      res.setHeader(
        'WWW-Authenticate',
        'Basic realm=Your realm, charset="UTF-8"',
      );
      res.sendStatus(401);
    }

    next();
  }
}

@Module({})
export class QueuesModule implements NestModule {
  static register(): DynamicModule {
    const testQueue = BullModule.registerQueue({
      name: 'test',
      defaultJobOptions: {
        attempts: 3,
        backoff: {
          type: 'exponential',
          delay: 1000,
        },
      },
    });

    if (!testQueue.providers || !testQueue.exports) {
      throw new Error('Unable to build queue');
    }

    return {
      module: QueuesModule,
      imports: [
        BullModule.forRoot({
          connection: {
            host: 'localhost',
            port: 15610,
          },
        }),
        testQueue,
      ],
      providers: [TestProcessor, ...testQueue.providers],
      exports: [...testQueue.exports],
    };
  }

  constructor(@InjectQueue('test') readonly queue: Queue) {}

  configure(consumer: MiddlewareConsumer) {
    const serverAdapter = new ExpressAdapter();
    const { addQueue, removeQueue, setQueues, replaceQueues } = createBullBoard(
      { queues: [new BullAdapter(this.queue)], serverAdapter },
    );
    serverAdapter.setBasePath('/queues');
    consumer
      .apply(BasicAuthMiddleware, serverAdapter.getRouter())
      .forRoutes('/queues');
  }
}

@lodi-g will you be able to create an "official" nestJS example?

@felixmosh Done in #569

@felixmosh @lodi-g coming back to this issue, I've just published a NestJS module which greatly simplifies using bull-board with Nestjs. 😄
https://github.com/DennisSnijder/nestjs-bull-board

Looks cool @DennisSnijder, can it be implemented as ServerAdapter (as part of this lib)?

Looks cool @DennisSnijder, can it be implemented as ServerAdapter (as part of this lib)?

Looking at the IServerAdapter, I don't think so. NestJS is more of a framework layer on top of Express/Fastify. The module I created ultimately uses the ExpressAdapter (since that's the default for NestJS). From there the module makes it easy to register bull-board in the framework's dependency injection container and consume the registered queue's from there.
However, it could be an interesting addition to the bull-board library, since I've seen quite some people trying to use bull-board with NestJS. The module just makes it easier to get it integrated with NestJS. Let me know what you think 😄

I'm not familiar with Nest.js...
It can be part if the bull-board scope, I need a small example of a nest project that uses your lib (to understand the usage) can you prepare one?

I'm not familiar with Nest.js... It can be part if the bull-board scope, I need a small example of a nest project that uses your lib (to understand the usage) can you prepare one?

Yes! I can do that! i'll link you the repository in a bit.

@felixmosh here you go! https://github.com/DennisSnijder/nestjs-bull-board-example
Make sure to run the redis container using the docker-compose.yml 😄.
The example illustrates a minimal setup using @nestjs/bullmq library and the nestjs-bull-board library I created. If there's any confusion and or questions, let me know 😃.

@DennisSnijder it looks really clean ...
Few small things that pop to mind

Where there is an access to the bull-board dynamic api (what is returns when you call to createBullBoard)
There is a way to change the underline express.js in nest.js, if so, where you can pass different server adapter?

@DennisSnijder it looks really clean ... Few small things that pop to mind

Where there is an access to the bull-board dynamic api (what is returns when you call to createBullBoard)
There is a way to change the underline express.js in nest.js, if so, where you can pass different server adapter?

Thanks for the feedback!
For the first one, i'll update the example on how to do that!
For the second one, at the moment the ExpressAdapter is hardcoded, however.... NestJS only supports Express and Fastify, since you also have a Fastify adapter available, i'll take a look into supporting Fastify. Thanks!

@felixmosh I just updated the package to 1.2.0, update allows you to pass in either ExpressAdapter or FastifyAdapter. 😄
This is how that looks.
 BullBoardModule.forRoot({
    route: "/queues",
    adapter: FastifyAdapter, //or ExpressAdapter
 }),

@DennisSnijder, Looks GREAT!
Can you prepare a PR with a new package (@bull-board/nestjs-module) (wdyt about the name?) with the content of your lib, and let's make an example that uses this module (can be this example), let me know if you need any help.
Thank you for your contribution.

@DennisSnijder, Looks GREAT!
Can you prepare a PR with a new package (@bull-board/nestjs-module) (wdyt about the name?) with the content of your lib, and let's make an example that uses this module (can be this example), let me know if you need any help.
Thank you for your contribution 🙏🏼.

Thanks! Sure! I will start working on the PR! Regarding the name, when it comes to other NestJS module packages, they rarely use the word "module" in there. Perhaps @bull-board/nestjs is just fine, what do you think? 😄

This is the reason that I've asked, since I'm not familiar with Nest.js ecosystem :]

Thanks @DennisSnijder I wouldn't have succesfully set this up without your original example,
@felixmosh I would consider adding this into examples


Weird line-wrapping issue with visual-fill-column-mode

Hi,
elfeed has a strange collision with visual-fill-column-mode.  Here's my
(simplified, tested) config:
(require 'elfeed)
(require 'visual-fill-column)
(add-hook 'elfeed-show-mode-hook 'visual-fill-column-mode)

(setq elfeed-feeds '("https://planet.emacslife.com/atom.xml"))

When I run elfeed, populate the search buffer, then select an article (i.e.,
enter elfeed-show-mode), this is what happens:
Versus the regular elfeed-show buffer, i.e., with visual-fill-column-mode
disabled:
However, even with visual-fill-column-mode enabled, as soon as I hit g it
re-fills:

Now, this by itself wasn't an issue for me.  I thought, “I can just add a hook
or advise or something!”  I tried adding elfeed-show-refresh to
elfeed-show-mode-hook, which I'm sure you can guess did nothing.  I tried
advising elfeed-show-entry with elfeed-show-refresh (also silly),
elfeed-show-refresh--mail-style with a function to cl-flet all the shr
filling functions to pretty much nil (see this SE
post
for those details), and finally added this to elfeed-show-mode-hook:
(defun elfeed@fix-it ()
             (run-with-timer 0.05 nil #'elfeed-show-refresh))

Obviously, that function is super clunky and weird.  I think this might be an
issue in shr itself (setting shr-width sidesteps the issue, but it
persists), given the SE question and answers.  Anyway, any ideas are welcome,
and if you need more tests or explanations I'll do my best to provide.  Thanks
for elfeed!

While this issue is still weird, I'm able to fix it by setting visual-fill-column-width to (+ fill-column 5) for now.  So I'm going to close it.


Migrate APIs to be schema-driven

Description: Enhance Meshery’s APIs capability by migrating to a schema-driven approach, which will ensure consistency, validation, and easier integration. It involves versioning and defining API schemas using OpenAPI/Swagger at https://github.com/meshery/schemas and auto generating structs. You will be ensuring all Meshery APIs aligns with defined schemas and are consistent.

Expected Outcome: Identifying APIs and updating them to conform these schemas. Enhance API documentation to reflect the schema-driven approach. Updating APIs to ensure they are consistent and doing validation against defined schemas.

Recommended Skills: Golang, Kubernetes, Swagger, JSON schemas, familiarity with React, Nextjs would be helpful

Mentor(s): Lee Calcote (@leecalcote, leecalcote@gmail.com), Yash Sharma (@Yashsharma1911, <EMAIL_ADDRESS>

Contributor Guides and Handbook

🛠 Meshery Build & Release Strategy
📚 Instructions for contributing to documentation

Meshery documentation site and source

🎨 Wireframes and designs for Meshery UI in Figma
🙋🏾🙋🏼 Questions: Discussion Forum and Community Slack

Hi @Yashsharma1911,
I am interested in working on the LFX project related to Meshery. I have a question regarding the project agenda:
Are all the APIs in the meshery repository going to be built from scratch using a schema-driven approach/Swagger.
Thank You.

Hello, I am interested in contributing to this issue as part of the LFX mentorship program

Hey @Yashsharma1911, just wanted to know by when will the mentee be selected for this project ? Because I think the deadline was 27 Aug 5.00 AM PDT.

@Omarabdul3ziz @rahulbansal3005, great start participating.
@Ash-2k3 selection is based on supporting existing contributors. I encourage you to start participating today. The weekly Meshery Dev meeting starts in a few minutes...

Sure, thankks!!!

Meshery’s APIs

From where can I find Meshery’s APIs documentations?

@prachinandi here - https://docs.meshery.io/extensibility/api

@prachinandi, in fact, that page needs a small update to include ``` or <pre> around the two API path references at the bottom of the page (e.g. /api/perf). Open a PR, if you'd like to fix it...

@prachinandi, in fact, that page needs a small update to include ``` or \<pre\> around the two API path references at the bottom of the page (e.g. /api/perf). Open a PR, if you'd like to fix it...

Done! https://github.com/meshery/meshery/pull/12215


changed cart route

Assignee Tasks

[ ] added unit tests (or none needed)
[ ] written relevant docs (or none needed)
[ ] referenced any relevant issues (or none exist)

Guidelines
Please add a description of this Pull Request's motivation, scope, outstanding issues or potential alternatives, reasoning behind the current solution, and any other relevant information for posterity.

Your PR Notes Here

changed cart route


Really delete the backup database

The variable name was apparently typo'd.
(You might want to consider setting "set -u" to make sure no undefined variables are read from. Likewise, "set -e" might be useful, to stop execution on a failed command.)

these both look good. i wont be back in front of laptop until tmrw, but i can test/merge then. glad youre findng the prj useful :)

Yes, thank you for your work here, this project has been very useful :)
I have a habbit of creating temporary WIP commits, then later cleaning them up by pulling them apart, reordering and/or merging them to create proper single-issue commits, and being able to do that with the sqlite database too is very nice.


ValueError: Invalid boundary in multipart form: b''

[2017-05-11 15:27:24 +0200] [30466] [ERROR] Error handling request /search/csv
Traceback (most recent call last):
  File "/srv/addok/venv/lib/python3.4/site-packages/gunicorn/workers/sync.py", line 135, in handle
    self.handle_request(listener, req, client, addr)
  File "/srv/addok/venv/lib/python3.4/site-packages/gunicorn/workers/sync.py", line 176, in handle_request
    respiter = self.wsgi(environ, resp.start_response)
  File "/srv/addok/venv/lib/python3.4/site-packages/falcon/api.py", line 180, in __call__
    process_request(req, resp)
  File "/srv/addok/venv/lib/python3.4/site-packages/falcon_multipart/middleware.py", line 20, in process_request
    form = self.parse(stream=req.stream, environ=req.env)
  File "/srv/addok/venv/lib/python3.4/site-packages/falcon_multipart/middleware.py", line 10, in parse
    return self.parser(fp=stream, environ=environ)
  File "/usr/lib/python3.4/cgi.py", line 559, in __init__
    self.read_multi(environ, keep_blank_values, strict_parsing)
  File "/usr/lib/python3.4/cgi.py", line 681, in read_multi
    raise ValueError('Invalid boundary in multipart form: %r' % (ib,))
ValueError: Invalid boundary in multipart form: b''

Encountered the same error, the problem in my case was in Content-Type header which I was setting explicitly on the client side. Related StackOverflow question
tldr: Do not set Content-Type header on the client side.


Revert "Use emitCopy/Destroy value instead of LoweredCopy/Destroy for large types"

radar rdar://problem/34209577
reverts a change to unblock the bots. will investigate later

@swift-ci Please smoke test and merge

@swift-ci please test and merge


Cannot read property 'prototype' of undefined

Environment:
Meteor,
Angular 6
I'm trying to import exceljs with the code below:
var Excel = require('exceljs');
But it always gives me this error:
Uncaught TypeError: Cannot read property 'prototype' of undefined
Any ideas?

Try changing it to:
var Excel = require('exceljs/dist/es5/exceljs.browser.js')

Thanks @zgriesinger  it worked!


QUEUE AND TOPIC DECORATORS

This pr adds Topic and Queue Decorators, adds the service bus receiver in context and updates the documentation.

Hi @Niurmiguel,
what do you think about the changes?

Hi @Santiagomrn,
Thank you so much for your contribution! I really appreciate the effort and time you've put into improving this project.
I haven't had the chance to review your contribution in detail yet, but I plan to do so soon. I'll get back to you once I've had a chance to look it over.


Request for more regions in goto/select

The current SWS extensions offer an action to "Go to/select region 1 (obeys smooth seek)", it is available for regions 1,2,3,4. Would it be possible to offer more regions? 10 regions would be good.

It's customizable via a setting:

Options > Show REAPER resource path in explorer/finder
Open S&M.ini in a text editor
Close REAPER
Search for S&M_GOTO_SEL_REGION=4
Edit the number and save
Start REAPER

Ah, that is perfect. Thank you!
fre. 23. juni 2023 kl. 14:26 skrev Christian Fillion <
@.***>:

Closed #1771 https://github.com/reaper-oss/sws/issues/1771 as not
planned.
—
Reply to this email directly, view it on GitHub
https://github.com/reaper-oss/sws/issues/1771#event-9617322021, or
unsubscribe
https://github.com/notifications/unsubscribe-auth/ABKTFTMZUBT64YN2O5D7EULXMWDN5ANCNFSM6AAAAAAZRJ3Y3I
.
You are receiving this because you authored the thread.Message ID:
@.***>


Daily Active Users Logging

For the new pricing of ZITADEL we have some new metrics which we should be able to limit. To be able to collect the data outside of ZITADEL, ZITADEL has to log each time a request is done.
Acceptance Criteria

[ ] ZITADEL logs when a user is "active" --> token, OIDC session, SAML session, session
[ ] Required fields in the log are user id, instance id, trigger/method
[ ] If possible in a performant way user type should be logged as well, if not, the data can also be collected in a different way
[ ] Optional fields are organization id (nice to have, but not neccessary to limit the free tier at the moment)

@eliobischof @stebenz
Can you please estimate this issue latest till lunch of 12. October?

Just had a discussion with @fforootd that we could also log the information of the user_id, instance_id at least, maybe additionaly  organization_id and user type.
In that case we can collect the data outside of zitadel

I rewrote the issue for the first part that should be implemented in ZITADEL (logging)
Let me know if anything is unclear


feat(pdf): introduce rate limiting

The */pdf route is quite expensive and will burn the CPU before any network-level rate limiting catches on.
This will allow only 2 calls per 2 seconds, happy to discuss better defaults here.
My reasoning was that this will allow the odd miss-click but effectively throttles any malicious request to 1 per second

Nice, from a code perspective, I love it. Did you by any chance try out if we can have a custom error page for the resulting error? Just a prettier page than just text? Kind of like out 403 error page?

I did not look into this as I only expect non-compliant users to see that error page 😇

I did not look into this as I only expect non-compliant users to see that error page 😇

Caaaaan you? 😇

@chohner
I believe there are two issues here, but please correct me if I am wrong:

Someone is overusing the PDF endpoint (potentially causing a DDoS attack and/or heavy PDF downloads by non-JS users)

is there something we can do on the platform level such as an ingress-nginx rate limit like this https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/#rate-limiting

Someone is excessively using the click event (JS users making multiple clicks).

can we use debounce or throttle for the button event? https://medium.com/@shubham3480/debouncing-and-throttling-in-react-e71c711fc6c5

We looked into infra solutions but I think the /pdf route is much more sensitive to traffic, so no global rule can work. So configuring project-level traffic considerations in the project itself seems like the right approach
One can just spam GET requests, no frontend solution can work here afaik :/


Sort targets for outputting to xcodeproj.

Motivation:
Repeated runs of generate-xcodeproj generate different results
as Set is used to store targets which is ordered by hash.
Hash is randomly seeded between runs making the set be differently
ordered on each run.
Having the output reordered on rerun makes comparison very difficult
and is particularly annoying if the generated project is to be stored
in revision control or similar.
Change:
Sort the targets before output, removing the major
source of differences between runs.

@swift-ci please smoke test


New version: Citadel5-JP.GS-Base version 21.1.1

Checklist for Pull Requests

[ ] Have you signed the Contributor License Agreement?
[ ] Is there a linked Issue?

Manifests

[ ] Have you checked that there aren't other open pull requests for the same manifest update/change?
[ ] This PR only modifies one (1) manifest
[ ] Have you validated your manifest locally with winget validate --manifest <path>?
[ ] Have you tested your manifest locally with winget install --manifest <path>?
[ ] Does your manifest conform to the 1.6 schema?

Note: <path> is the directory's name containing the manifest you're submitting.

Microsoft Reviewers: Open in CodeFlow

Hi,
How can I solve the branch conflict:
I published a new version 21.1.1 of the installer/package on my web server in the same location and with same name overwriting the previous one (the file name includes the major version number only, which is 21.1 in this case).
Shall I remove the previous 21.1 manifest (to avoid the sha256 mismatches)?
Thanks
J.Piechura, Citadel5, https://citadel5.com

Hi J.Piechura, aka @Citadel5-JP,
It seems that this PR attempts to add the root file from the 21.1 version:

If this could be reverted, then the PR should pass this check.


feat: skip aligned base image check based on metadata config

Description
This PR introduces a new section to our .tractusx metadata file. The section skipReleaseChecks.alignedBaseImage allows to configure file paths to Dockerfiles, that are not published to DockerHub. The configuration is based on trust and is not verified automatically.
If Dockerfiles are configured to skip the aligned base image check, the automated TRG checks will not report issues on that Dockerfile, even if it is not based on images aligned via TRG 4.02.
This PR also adds a first chapter to the /docs folder. I think that can be useful in multiple ways

We can link to documentation related to the metadata file and reference to it in the TRG, so we do not duplicate content
We have an easier entry for everyone, who want to contribute
We can document decisions and reasons behind them

related to eclipse-tractusx/sig-infra#309

I guess then we need also update this one
https://eclipse-tractusx.github.io/docs/release/trg-2/trg-2-5

I guess then we need also update this one https://eclipse-tractusx.github.io/docs/release/trg-2/trg-2-5

Yes, like mentioned in the description. A link to the metadata file docs should be enough in the TRG


poolmaster support

According to: https://xapi-project.github.io/xen-api/metrics.html
RRDs are resident on the server on which the VM is running, or the pool master when the VM is not running.
However, we need the poolmaster to decode the UUID's.
This commit adds functionatlity to find the poolmaster IP, so that the api connection always goes to the poolmaster.
When not in a cluster, the single host is the "poolmaster".
RRD files are downloaded from the host directly.
Tested the build in my own fork, and works perfectly.
(if you want, you can test solipsist01/xen-exporter)
Thank you for your work on this exporter. We're loving it!

about the poolmaster,
The reason is that poolmaster can change.
what if host 1 is poolmaster, and due to a hardware failure, now another
host is poolmaster.
or, someone is upgrading a xenserver version on all hosts, but let's the
poolmaster on another host.
then we would need to reconfigure our containers / prometheus setup. This
method makes sure it always works.
About the exception: I got some error on one of my hosts about an SR UUID
which it could not find.
it could be:
try:
   return session.xenapi.SR.get_name_label(session.xenapi.SR.get_by_uuid(sr_uuid))
except XenAPI.XenAPI.Failure as a:
   print(str(a))

@.***:/docker/compose/prometheus# docker logs xen08 -f
<IP_ADDRESS> - - [07/Dec/2022 12:23:51] "GET /metrics HTTP/1.1" 200 -
Exception occurred during processing of request from ('<IP_ADDRESS>', 35950)
Traceback (most recent call last):
File "/usr/local/lib/python3.10/socketserver.py", line 316, in
handle_request_noblock
self.process_request(request, client_address)
File "/usr/local/lib/python3.10/socketserver.py", line 347, in
process_request
self.finish_request(request, client_address)
File "/usr/local/lib/python3.10/socketserver.py", line 360, in
finish_request
self.RequestHandlerClass(request, client_address, self)
File "/app/xen-exporter.py", line 219, in init
super().init(request, client_address, server)
File "/usr/local/lib/python3.10/socketserver.py", line 747, in init
self.handle()
File "/usr/local/lib/python3.10/http/server.py", line 432, in handle
self.handle_one_request()
File "/usr/local/lib/python3.10/http/server.py", line 420, in
handle_one_request
method()
File "/app/xen-exporter.py", line 225, in do_GET
self.wfile.write(collect_metrics().encode("utf-8"))
File "/app/xen-exporter.py", line 161, in collect_metrics
sr = get_or_set(srs, x.split("")[0], lookup_sr_name_by_uuid, xen)
File "/app/xen-exporter.py", line 63, in get_or_set
d[key] = func(key, *args)
File "/app/xen-exporter.py", line 26, in lookup_sr_name_by_uuid
return
session.xenapi.SR.get_name_label(session.xenapi.SR.get_by_uuid(sr_uuid))
File "/usr/local/lib/python3.10/site-packages/XenAPI/XenAPI.py", line
264, in call
return self.__send(self.__name, args)
File "/usr/local/lib/python3.10/site-packages/XenAPI/XenAPI.py", line
160, in xenapi_request
result = _parse_result(getattr(self, methodname)(*full_params))
File "/usr/local/lib/python3.10/site-packages/XenAPI/XenAPI.py", line
238, in _parse_result
raise Failure(result['ErrorDescription'])
XenAPI.XenAPI.Failure: ['UUID_INVALID', 'SR',
'6e27b042-8dd8-63f0-00ab-af17e0c1414e']
Op wo 7 dec. 2022 om 15:04 schreef Michael Dombrowski <
@.***>:

@.**** commented on this pull request.
Thank you very much for your interest in the project and for your
contribution!
I have left 2 comments which are mostly questions that I'd like to
understand before approving.
In xen-exporter.py
https://github.com/MikeDombo/xen-exporter/pull/2#discussion_r1042242341:

@@ -22,7 +23,10 @@ def lookup_vm_name(vm_uuid, session):

def lookup_sr_name_by_uuid(sr_uuid, session):

return session.xenapi.SR.get_name_label(session.xenapi.SR.get_by_uuid(sr_uuid))

try:

  return session.xenapi.SR.get_name_label(session.xenapi.SR.get_by_uuid(sr_uuid))

except:

Why is this ignoring errors now?
What error is happening?
I'd be alright with this, but it should be except Exception and then
should print out the error that happened.
In xen-exporter.py
https://github.com/MikeDombo/xen-exporter/pull/2#discussion_r1042244779:

@@ -62,6 +66,19 @@ def get_or_set(d, key, func, *args):
d[key] = func(key, *args)
return d[key]

+def collect_poolmaster():

xen_user = os.getenv("XEN_USER", "root")
xen_password = os.getenv("XEN_PASSWORD", "")
xen_host = os.getenv("XEN_HOST", "localhost")
verify_ssl = "false"
verify_ssl = True if verify_ssl.lower() == "true" else False
try:

  with Xen("https://" + xen_host, xen_user, xen_password, verify_ssl) as xen:

     poolmaster = xen_host

except XenAPI.XenAPI.Failure as e:

  ipPattern = re.compile('\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}')

While I'm sure this works, why not just add a new configuration for the
poolmaster's address?
—
Reply to this email directly, view it on GitHub
https://github.com/MikeDombo/xen-exporter/pull/2#pullrequestreview-1208473120,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AD5VRHMG5NDJTISWDTY3D4LWMCKONANCNFSM6AAAAAASWQLMWM
.
You are receiving this because you authored the thread.Message ID:
@.***>

Thank you very much for the contribution again!


TBD: access mixins: support for custom exceptions

I wanted to use a custom exception with SuperuserRequiredMixin (Http404) and added support for it.
raise_exception can now be True, False, a custom exception or a callable (that should return a response).
I have then factored the no-permission handling into a separate function, and moved redirect_unauthenticated_users to the base mixin.
This does not include any documentation changes yet, because I wanted to gather feedback on it first.
E.g., I am not sure if handle_no_permission should fall back to raising an exception for any non-HTTP-response (not isinstance(ret, (HttpResponse, StreamingHttpResponse))).

@kennethlove
Can you please provide some feedback to my last comment?
I can (try to) rebase it again, of course.

Thanks for merging!
However, it is missing docs probably and some questions are unanswered.
Should be followed up in #173 though anyway.


fix https://github.com/ansible-lockdown/RHEL9-CIS/issues/58

Overall Review of Changes:
As per issue #58, setting faillock values from /etc/security/faillock.conf is not enough.
For the lockout policy to work, we need to add some parameters to the pam config files.
Issue Fixes:

https://github.com/ansible-lockdown/RHEL9-CIS/issues/58

How has this been tested?:
Yes, tested on my VM and the lockout is working.

hi @jayolinares
Thank you for taking the time to raise the issue and write and test this PR. Really appreciate the effort that it takes to go through and ensure it works as expected.
Initial testing looks positive. I have noted that the tags are missing for that rule also. If you could add the following
  tags:
      - level1-server
      - level1-workstation
      - patch
      - rule_5.5.2

many thanks
uk-bolly

Hi @uk-bolly,
Thanks for reviewing the PR.
Ok, tags have been added.


fix: state handling for service instance creation or update fails

Purpose

This PR fixes an issue with the state handling of failed service instance resource creations or updates
Before this PR a state was persisted with new values despite the operation to reach the new state failed
This could cause wrong plan results as the parameters of service instances cannot be read form the platform
closes #779

Does this introduce a breaking change?

[ ] Yes
[X] No

Pull Request Type
What kind of change does this Pull Request introduce?

[X] Bugfix
[ ] Feature
[ ] Refactoring (no functional changes, no api changes)
[ ] Documentation content changes
[ ] Other... Please describe:

How to Test

Test the code via automated test

go test ./...

Additional test steps

Execute a invalid state change with wrong parameters of a service instance -> terraform apply fails
Execute a terraform plan

What to Check
Verify that the following are valid:

Automated tests are executed successfully
The Terraform plan states that changes need to be done

Other Information
n/a
Checklist for reviewer

The following organizational tasks must be completed before merging this PR:

[X] The PR is assigned to the Terraform project and a status is set (typically "in review").
[X] The PR has the matching labels assigned to it.
[X] The PR has a milestone assigned to it.
[X] If the PR closes an issue, the issue is referenced.
[X] Possible follow-up items are created and linked.

Fixture drift is okay as all fixtures for the service instances have been re-generated
Warning for non-inclusive language usage cannot be resolved as they are due to API responses from the platform that are not in scope of this project


TypeError: crypto.createHmac is not a function

I am facing a issue while converting object to jwt token here is the following code and error blocks can anyone give me solution for this
const secret = "werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn";
      function TokenGenerator(secretOrPrivateKey, secretOrPublicKey, options) {
          this.secretOrPrivateKey = secretOrPrivateKey;
          this.secretOrPublicKey = secretOrPublicKey;
          this.options = options; //algorithm + keyid + noTimestamp + expiresIn + notBefore
      }

      TokenGenerator.prototype.sign = function (payload, signOptions) {
          const jwtSignOptions = Object.assign({}, signOptions, this.options);
          return jwt.sign(payload, this.secretOrPrivateKey, jwtSignOptions);
      }

      const tokenGenerator = new TokenGenerator(secret, secret, { algorithm: 'HS256', keyid: '1', noTimestamp: false, expiresIn: '2m', notBefore: '2s' })
      var token = tokenGenerator.sign(user, { audience: 'myaud', issuer: 'myissuer', jwtid: '1', subject: 'user' })
      console.log(token);
  }

error:

LoginComponent.html:16 ERROR TypeError: crypto.createHmac is not a function
    at Object.sign (index.js:34)
    at Object.jwsSign [as sign] (sign-stream.js:23)
    at Object.webpackJsonp.../../../../jsonwebtoken/sign.js.module.exports [as sign] (sign.js:186)
    at TokenGenerator.sign (login.component.ts:45)
    at LoginComponent.webpackJsonp.../../../../../src/app/login/login.component.ts.LoginComponent.onLoggedin (login.component.ts:50)
    at Object.eval [as handleEvent] (LoginComponent.html:16)
    at handleEvent (core.es5.js:11852)
    at callWithDebugContext (core.es5.js:13060)
    at Object.debugHandleEvent [as handleEvent] (core.es5.js:12648)
    at dispatchEvent (core.es5.js:8830)

Using Angular 4

we're facing the same issue, although our IDE (IntelliJ IDEA) knows about the function.

Let's see if someone from the community has a solution. Since the library expects to work under NodeJS environment I'm not sure if that browser/builder has some issue/lack for crypto library.
If I may ask, why do you need to create a JWT token and use HMAC from browser code? It is usually the other way around, server will sign and browser/server will verify.

In our case we're using the sign method for testing purposes. Because it is more comfortable to write tests with something like:
let payloadWithExp = {     "exp":<PHONE_NUMBER>   };    const accessToken =  sign(payloadWithExp,"test-secret")
instead of
const accessToken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjcyMjc4NDY5MTJ9.g6aWa5kckTBIwrxOg5I-z7xUmSagrPI7CGZWksFE4Fg";
because we can easily change the values to what we need...

I see, I'd say you could use this other library https://github.com/kjur/jsrsasign/wiki/Tutorial-for-JWT-generation. We've recommended it in the past for browsers.


feat: Add core-env logging package solution

Renamed the branch to follow naming convention

Renamed the branch to follow naming convention

can you please provide a better description about what this PR is trying to achieve

reviewing over the next 12h


French translation of Claim Your Front End Development Certificate

[ ] Claim Your Front End Development Certificate

Issue moved to FreeCodeCamp/TranslationExpansion #73 via ZenHub


Include test files in sdist

Fixes #162

Current coverage is 80.92% (diff: 100%)

Merging #163 into master will not change coverage

@@             master       #163   diff @@
==========================================
  Files             5          5
  Lines           802        802
  Methods           0          0
  Messages          0          0
  Branches          0          0
==========================================
  Hits            649        649
  Misses          153        153
  Partials          0          0

Powered by Codecov. Last update 75bc04b...dbfb8a5

Thanks!


For BSD/APPLE platform using native random calls.

Solution not involving file descriptors, seeded upon fork and in
a regular basis.

Thanks for the patch! Could you please clarify why is this needed?

In some configurations, file descriptors can be limited so this is the opportunity to save one, to get really proper randomness without having to reseed manually while having good performance.

Thanks for clarifying. I don't think that this is a strong enough reason for complicating the code with additional preprocessor directives. Plus, we don't have any infrastructure to test BSD/Apple specific changes at this point.


Add link to aboutus.rst and note about LICENSE in README.rst

aboutus.rst is up to date for included commits, but
see skirpichev/omg#220

Current coverage is 88.99%

Merging #221 into master will decrease coverage by -0.01% as of 5f01f0f

@@            master    #221   diff @@
======================================
  Files          354     354
  Stmts        87267   87267
  Branches     21743   21743
  Methods          0       0
======================================
- Hit          77676   77667     -9
- Partial       3159    3162     +3
- Missed        6432    6438     +6

Review entire Coverage Diff as of 5f01f0f

Powered by Codecov. Updated on successful CI builds.


fp8 compute error

I try https://github.com/KnowingNothing/MatmulTutorial/blob/main/examples/matmul/this-fp8/matmul-fp8-v0.cu in hopper, but get "an illegal memory access was encountered".

FP8 is not ready. I have no access to Hopper devices. I tried to use 4090 but FP8 is not supported by ptxas so far. I can't continue developing this kernel until I get one Hopper device.
If you have access to Hopper devices, feel free to continue developing this kernel and contribution is highly welcomed!

It's seem that https://github.com/KnowingNothing/MatmulTutorial/blob/6cba2fb4cb5a14b1b9e8978bd05dcc758fa5f111/examples/matmul/this-fp8/matmul-fp8-v0.cu#L345C4-L345C5 have a wrong offset

In addition, I would like to ask you about the wgmma matrix layout descriptor. I have some question here:
1. For matrix B, your code loads it from gmem to smem and rearranges it, changing the column-major of the previous element level into the column major of the core matrix level. Is it right?
2. for this fig https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#wgmma-64n16-core-matrices-b,I think it describes how the data of matrix b is arranged on smem, where the number represents the element index on gmem, is it right?

I have gotten access to one H100 machine and fixed the FP8 kernel. Althought the performance is bad, the compute results are correct now. As for your questions,

My kernel assumes matrix B is column-major in gmem, and when loading it from gmem, I change the layout to [n/8,k/16,8,16] in smem, which corresponds to the core matrix layout. Each core matrix is also column-major for matrix B.
Yes, the numbers in the figure are the index of elements.

now, the code is right, but for this commit，https://github.com/KnowingNothing/MatmulTutorial/commit/89bde23e0768d04acf70a15bb7e9d8852554c743，Why you swap the value of leading dimension and stride dimension? For matrix B, each core matrix is column-major with shape of 16x8.  From nv docuemnt, leading dimension is for K Dimension, It seems leadding dimension should be  16, and stride dimension offset is 8?

Honestly speaking, I am not sure about this. I have tried different settings for these two paramters and the current setting is the only one that works. I need more time to understand why.

Thank you very much!


fix tensorflow import error

moved tensorflow import in TensorFlowBackend to init
importing it as class variable prompts import error

This is broken internally.
The problem is is that if any code isn't imported simply by import tensornetwork with the exception of importing the backend libraries (numpy, tensorflow, etc) then that code doesn't get picked up by the bazel par_binary. https://google.github.io/subpar/subpar.html
I'm still thinking about how to work around this...

Can you clarify? Trying to look into root cause of this but I'm a bit confused atm.

Basically our internal build system really does not like dynamic imports.
@MichaelMarien @mganahl @gecrooks I'll take the lead on this one guys. It's super fragile at the moment and I need to make sure everything works both on the pip and internally.

That's fixable. Just less elegant.

Closing this PR as it breaks our stuff internally.


feature: add pubnet service address discover for nacos registry

[ ] I have registered the PR changes.

Ⅰ. Describe what this PR did
Ⅱ. Does this pull request fix one issue?

Ⅲ. Why don't you add test cases (unit test/integration test)?
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews

为什么不使用SEATA_IP或者-h？
该场景为server运行时动态绑定公网地址通过ingress暴露，非启动时注入，客户端通过配置项做公网地址的服务发现

为什么不使用SEATA_IP或者-h？
该场景为server运行时动态绑定公网地址通过ingress暴露，非启动时注入，客户端通过配置项做公网地址的服务发现

server都在运行中了，服务已经暴露至nacos中，何以自动绑定成公网ip又通过k8s ingress暴露，且注册在nacos中的？可以详细讲下这个服务注册的流程吗？

Configuration item completion: https://github.com/seata/seata/blob/develop/seata-spring-autoconfigure/seata-spring-autoconfigure-client/src/main/resources/META-INF/additional-spring-configuration-metadata.json

this config can be auto added as it's part of nacos @ ConfigurationProperties


Alert is not expected with groupby

I found something strange for alert evaluation. It seems kapacitor will wrongly check the status of different group together in the first batch of data.
My tick is as below.
var from = stream|from()
		.database('test')
		.retentionPolicy('oneday')
		.measurement('M1')
		|groupBy('host')
from|alert()
		.crit(lambda: "metric" > 100)
		.id('{{ .TaskName }}')
		.message('')
		.details('')

And the data is as the table shows:

time
host
metric

2018-07-24T09:00:00Z
host1
120

2018-07-24T09:00:00Z
host2
10

2018-07-24T09:00:10Z
host1
120

2018-07-24T09:00:10Z
host2
10

2018-07-24T09:00:20Z
host1
120

2018-07-24T09:00:20Z
host2
10

What I got from the triggered alerts are

time
level
host
metric

2018-07-24T09:00:00Z
CRITICAL
host1
120

2018-07-24T09:00:00Z
OK
host2
10
<- seems wrong

2018-07-24T09:00:10Z
CRITICAL
host1
120

2018-07-24T09:00:20Z
CRITICAL
host1
120

This will only be triggered at the first batch of data (restart or define). Then everything will back to normal.

@nathanielc Could you help me with this issue. It really bothered me a lot.
I think this is a bug when dealing with the first point in alert node.

Since you groupBy host, and redefine the alert, it will check all the combinations (host1 + M1 and host2 + M2). Is reporting OK on host 2 since is it's correct state.

When I group by host, host1 and host2's data should not compared together. But I found at the first batch, data are not splitted and host2's ok will reset host1's critical.

Hi!
Because you defined .id('{{ .TaskName }}') - all groups (hosts) is treated as one stream of data (tags are ignored)
This is how ID property works. By default ID includes all tags - so groups treated as separate streams.


Fix global hub inspector chart issue

Signed-off-by: myan<EMAIL_ADDRESS>If the value isn't ordered on the x-axis, then the chart is not plotted in chronological order.

/cc @clyang82 @ldpliu


osgearth port

original project can be found here: https://github.com/gwaldron/osgearth
Not sure best way to handle osgearth plugins so I based it off of the osg port file to put them into the tools folder.

 Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.:x: battleguard sign nowYou have signed the CLA already but the status is still pending? Let us recheck it.

Thanks for the PR and sorry for the long wait!


ibm-label is added to div incorrectly

Detailed description

Describe in detail the issue you're having.

I'm putting a div in ibm-label (which itself contains a textarea input).  Based on what I see here, this is supported.  However, when doing this the ID of input field is added to the div instead of the textarea.
This has some problems:

accessibility checker will flag that the ID of the label's for attribute is not on a valid input element
if ID is added to textarea by other means, it is duplicate with the ID on the div
also the label and its associated input field are not siblings, which may also be an accessibility problem

Is this a feature request (new component, new icon), a bug, or a general issue?

bug

Is this issue related to a specific component?

ibm-label

What did you expect to happen? What happened instead? What would you like to see changed?

ID is added to the correct input element, and also the label and input element should be siblings to avoid other potential accessibility problems.  Otherwise div should not be supported.

What browser are you working in?

Mainly Chrome

What version of the Carbon Design System are you using?

"carbon-components-angular": "^4.58.3"

What offering/product do you work on? Any pressing ship or release dates we should be aware of?

IBM ADDI
Steps to reproduce the issue

Step one
Step two
Step three
etc.

Additional information

Screenshots or code
Notes

Hey @makandre, could you please provide a snapshot of the HTML produced or even a code sandbox?

https://codesandbox.io/s/carbon-components-angular-forked-kvqhl7?file=/src/app/app.component.html
<ibm-label _ngcontent-syy-c8="" class="bx--form-item">
  The label

      <textarea _ngcontent-syy-c8="" aria-label="textarea" ibmtextarea="" class="bx--text-area"></textarea>

</ibm-label>


"Keep windows in their zones when the screen resolution changes" does not work correctly on all Virtual desktops

I use Remote Desktop Connection to connect to a desktop and use a super-ultra-wide monitor locally. When I connect to the remote desktop the resolution goes to my full screen(5120x1440). When I disconnect from it the remote desktop the resolution switches back to default for that computer (2560x1440).
On that computer I use multiple virtual desktops and on one of them I have a different zone layout compared to the rest.
Having "Keep windows in their zones when the screen resolution changes" checked I'd expect the windows to be kept in their zones on all Virtual Desktops, but only the focused one keep that way after resolution change. The others revert to some default location for all the windows.
ℹ Computer information

PowerToys version: 0.21.1
PowerToy Utility: FancyZones
Running PowerToys as Admin: YES
Windows build number: 1903 (OS Build 18362.1082)

📝 Provide detailed reproduction steps (if any)

Create a few Virtual desktops in Windows Task View
Have some of the Virtual desktops have a different zone layout (not sure if important)
Make sure "Keep windows in their zones when the screen resolution changes" is checked
Snap windows in some of the zones on each Virtual desktop
Change resolution of screen

✔ Expected result
The snapped windows should keep their location on all Virtual desktops
❌ Actual result
Only the snapped windows on the focused Virtual desktop have kept their location. The windows on al other Virtual Desktops have moved out of the zones.

Note: this is very easy to reproduce and doesn't require to use a remote connection:

snap a window to a zone on a VD
switch to a different VD
change the monitor DPI scaling

result: only the current current desktop is processed, the other VD are not

Note: this is very easy to reproduce and doesn't require to use a remote connection:

snap a window to a zone on a VD
switch to a different VD
change the monitor DPI scaling

result: only the current current desktop is processed, the other VD are not

I think, this still happens. It is especially annoying when letting the PC suspending and then waking up again: All my windows are moved to the main screen...
I think, this refs https://github.com/microsoft/PowerToys/issues/16395 and also https://github.com/microsoft/PowerToys/issues/19915.
Maybe, also https://github.com/microsoft/PowerToys/issues/18103 is related.


Added orderRaw

Updated #98 pull request, with test, readme, and renamed method orderRaw

Hi @aidynmakhataev! Thanks for the pull request. I'm merging it now, and will release soon.


nginx config example

I presume headscale-ui could be run via nginx, so any possibility of a config example?

map $http_upgrade $connection_upgrade {
    default      keep-alive;
    'websocket'  upgrade;
    ''           close;
}

server {
    server_name headscale-01.example.com;

    location /web {
        alias /usr/local/www/headscale-ui;
        index index.html;
    }

    location / {
        proxy_pass http://localhost:8080;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $connection_upgrade;
        proxy_set_header Host $server_name;
        proxy_redirect http:// https://;
        proxy_buffering off;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;
        add_header Strict-Transport-Security "max-age=15552000; includeSubDomains" always;
    }

    listen 443 ssl;
    ssl_certificate fullchain.pem;
    ssl_certificate_key privkey.pem;
    [...]
}

server {
    if ($host = headscale-01.example.com) {
        return 301 https://$host$request_uri;
    }

    server_name headscale-01.example.com;
    listen 80;
    return 404;
}


Skip readonly properties

The current will attempt to do $property->setValue($data, $item) which in the case of a readonly property will result into failure.
Having a glance at the tests it appears this should already be supported in theory, but I am running into this issue with laravel/serializable-closure v1.2.2 with PHP-Scoper. So this needs deeper investigation

Can you elaborate a little bit more on the issue you are having? Full error, how to reproduce, etc?

@nunomaduro I am sorry but I will need your help there.

Can you elaborate a little bit more on the issue you are having?

When upgrading PHP-Scoper to 8.1, I tried to take advantage of the readonly feature. However when building the PHAR with Box afterwards, I was getting a nasty out of memory process failure.
Digging a bit deeper, this seemed to be caused by the usage of amphp/parallel which Box is using by default. I am not entirely sure how to fix it there, but the issue is basically that executing the process in parallel results in an error, amphp collects those to then return a single aggregated exception with all failures. Turns out that in this specific case, each exception is about 9Mb... With the fact that there is easily a few thousand files... Yep you run out of memory very fast.
But this is an issue on amphp side. The underlying issue though, is from this library which I'm leveraging to serialize the closures allowing this parallel execution. Regarding the size of the stack trace, this is probably related to this library shenanigans that I don't understand much. But ultimately, my real problem is why I am getting an error in the first place.
The error
The actual error is:
\Error
- message: 'Cannot modify readonly property Humbug\PhpScoper\Configuration\Configuration::$patcher')`
- file: vendor/laravel/serializable-closure/src/Serializers/Native.php
- line: 391

When setting up a breakpoint, this is the offending code: https://github.com/laravel/serializable-closure/blob/e04e46a/src/Serializers/Native.php
Excerpt here for convenience:
                    } elseif (is_array($item) || is_object($item)) {
                        $this->mapPointers($item);
                        $property->setValue($data, $item);
                    }

And indeed, doing $property->setValue() on a readonly property is probably not correct.
The fix
I think the fix is actually fairly easy, we might debate about the semantics but from the look of it just skipping readonly properties seems good enough.
Reproducer
The original reproducer is:

clone PHP-Scoper
run make phpunit just to make sure everything is installed and in order
edit Configuration::$patcher in the constructor to make the property readonly
run bin/box compile

Now I understand this is not super practical for you, and finding a more narrow reproducer is a necessity for this patch.
PR issue
That's were I'm really in a pinch. Maybe it's just me being really unfamiliar with Pest but I'm hitting some strange issues:

using the --filter  results in Xdebug not being called (???)
passing a specific file to pest result in a failing test (but runs fine with all the tests...)

I also tried several things but I'm really not understanding how to hit the problematic path, I seem to be unable to find the right combination (i.e. the desired minimalist reproducer)

@theofidry Really appreciate your explanation. Yet, in order to have me allocate time to help you with your problem, you will need to:

Don't touch on existing tests.
Write a failing test in this repository.

I am really sorry if this is not the answer you hope, but my time is very limited.

It's a shame but we'll have to do without then. I already spend 7h on this issue, having a PR closed & no possible help is... frankly quite demotivating. I understand the rationale & the reason so I can't blame you for it, but I also really don't want to spend anymore time on this although it means not using any readonly property for 3 projects.

Hey @theofidry. I found some time to check into this again but @nunomaduro is right. As far as I can tell read only properties work just fine with this package. We've only gotten your report for it so far. Would be happy to have another look if you could provide a failing test.

Is there a fix? Facing the same issue unfortunately.

Not right now sorry.

@Wedrix actually things should work atm. Please provide a PR with a failing test if you believe it's not.

@Wedrix actually things should work atm. Please provide a PR with a failing test if you believe it's not.

The tests seem to indicate that this is the accepted behaviour which is kind of confusing. I'm sure there is a good reason for this implementation-wise but it is surprising behaviour from a user's perspective (see the RFC).

What do you mean? That tests shows that readonly properties can be serialized.


Logging with Constraints: ScreenLogger doesn't print information related to constraints

(Less of a bug and more of an oversight on my part)
Describe the bug
When using ScreenLogger, no information about the constrained optimization is printed.
To Reproduce
import numpy as np
from bayes_opt import BayesianOptimization
from scipy.optimize import NonlinearConstraint

def target_function(x, y):
    return np.cos(2*x)*np.cos(y) + np.sin(x)

def constraint_function(x, y):
    return np.cos(x) * np.cos(y) - np.sin(x) * np.sin(y)

constraint_limit = 0.5
constraint = NonlinearConstraint(constraint_function, -np.inf, constraint_limit)

# Bounded region of parameter space
pbounds = {'x': (0, 6), 'y': (0, 6)}

optimizer = BayesianOptimization(
    f=target_function,
    constraint=constraint,
    pbounds=pbounds,
    random_state=1,
)

optimizer.maximize(
    init_points=2,
    n_iter=10,
)

Expected behavior
I'm somewhat torn on what information should be output. I see a few options:

Just the value(s) of the constraint function(s) at the specific point
Just the "allowed"-ness of the point
Both the specific values and the "allowed"-ness
Colour disallowed points red and/or allowed points green
Just the value(s) of the constraint function(s) at the specific point, colour coded green/red for allowed/disallowed

Personally I'm leaning towards the second option to reduce clutter, but I'm open to other opinions. It would look something like this:
|   iter    |  target   |  allowed  |     x     |     y     |
-------------------------------------------------------------
| 1         | 0.4872    | False     | 2.502     | 4.322     |
| 2         | -0.2401   | True      | 0.0006862 | 1.814     |
| 3         | 0.7821    | False     | 2.304     | 4.326     |
| 4         | 1.249     | False     | 1.899     | 4.321     |
| 5         | 0.7351    | False     | 1.351     | 4.982     |
| 6         | 1.814     | True      | 1.534     | 3.757     |
| 7         | 1.793     | False     | 1.854     | 2.982     |
| 8         | 0.02935   | False     | 2.834     | 1.913     |
| 9         | 1.496     | False     | 1.108     | 3.106     |
| 10        | 0.5423    | True      | 5.99      | 0.06449   |
| 11        | 0.4597    | True      | 5.985     | 5.858     |
| 12        | -1.095    | True      | 5.986     | 2.891     |
=============================================================

I agree for the screen logger.
What about the json logger - there we should probably have the ability to read back in the constraint model the same way we can read back in the objective model?

What about the json logger - there we should probably have the ability to read back in the constraint model the same way we can read back in the objective model?

good point, didn't think of that at the time. Should this be in a separate issue?
@bwheelz36 do you have any preference as to how the ScreenLogger should behave?

I think the example you posted above with just True/False is adequate


Refine network context

Remove node information from classes, send node as arg when calling functions

Summary of this PR:

Previously, node RPC URLs were stored when creating PasskeyAccount/SimpleAccount/VerifyingPaymaster instances.
To prevent issues with outdated URLs, ensure all relevant classes and methods include the runner: ContractRunner.
Then, use the connect method to access necessary data from the network, e.g., passkey(), getNonce(), and getHash().
Additionally, methods requiring runner: ContractRunner include:

init(), initWithFactory(), getCredentialId(), getAddress(), isDeployed(), createUserOperation() in packages/account/xxx,
as well as requestPaymasterAndData(), getSignature(), requestPaymasterAndData() in packages/paymaster/xxx.

Q: Would it be correct to re-execute provider.connect(await initAccount(provider.node, account)) in the Background when a user changes the network (possibly using an event listener in Background)?


wsdl_headers not being passed to request

I've been trying to use a client generated by this library, but unfortunately I'm experiencing an issue where the wsdl_headers aren't being passed into the generated XML request body.
For example, with the node-soap library, I would do this:
soapClient.addSoapHeader({ AccessToken: { TokenValue: "some-access-token" } }, "", "tok");

The definition for this is:
addSoapHeader(soapHeader: any, name?: string, namespace?: any, xmlns?: string): number
add soapHeader to soap:Header node

In my example, this would produce a request that looks similar to this:
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
   <soap:Header>
      <typ:AccessToken>
         <typ:TokenValue>some-access-token</typ:TokenValue>
      </typ:AccessToken>
   </soap:Header>
   <soap:Body>
      <!--- SOAP BODY REMOVED FOR THIS EXAMPLE -->
   </soap:Body>
</soap:Envelope>

I've tried a few different approaches, but I'm not able to get the same functionality with this library. For example, none of the following correctly output a <header> element in the request (which results in the target API rejecting the request with a 401 unauthorized response):
wsdl_headers: { AccessToken: "some-access-token"  }

wsdl_headers: { AccessToken: { TokenValue: "some-access-token" } }

wsdl_headers: { tok: { AccessToken: { TokenValue: "some-access-token" } } }

Could you advise if I should use a different approach or if this is a bug.
Thanks

For clarification, not long after finishing this post, I realised that I create a client and then call addSoapHeaders.
Never open issues when you should be sleeping 😆


[processBridge]: Error: ENOENT: no such file or directory, open 'C:\Users\ADKi.vscode\extensions\anseki.vscode-color-0.4.1\node_modules\electron-prebuilt\path.txt'

[processBridge]: Error: ENOENT: no such file or directory, open 'C:\Users\ADKi.vscode\extensions\anseki.vscode-color-0.4.1\node_modules\electron-prebuilt\path.txt'

Hi @DukeAnn, thank you for the report.
Could you give me details?
https://github.com/anseki/vscode-color/blob/master/.github/ISSUE_TEMPLATE.md

[Extension Host] Error: ENOENT: no such file or directory, open 'C:\Users\Administrator.vscode\extensions\anseki.vscode-color-0.4.1\node_modules\electron-prebuilt\path.txt'
at Object.fs.openSync (fs.js:558:18)
at Object.module.(anonymous function) [as openSync] (ELECTRON_ASAR.js:173:20)
at Object.fs.readFileSync (fs.js:468:33)
at Object.fs.readFileSync (ELECTRON_ASAR.js:506:29)
at Object. (C:\Users\Administrator.vscode\extensions\anseki.vscode-color-0.4.1\node_modules\electron-prebuilt\index.js:4:42)
at Object. (C:\Users\Administrator.vscode\extensions\anseki.vscode-color-0.4.1\node_modules\electron-prebuilt\index.js:6:3)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)

Hi @ fujianxiamen, thank you for the report.
Could you give me details?
https://github.com/anseki/vscode-color/blob/master/.github/ISSUE_TEMPLATE.md

A dialog box is shown by pressing Alt + C P keys or command Pick Color. If a cursor is positioned on a string that is color notation at that time, that string is selected as target for editing.
https://github.com/anseki/vscode-color/raw/master/s-01.gif

@DukeAnn,
Could you give me details?
Please see this:
https://github.com/anseki/vscode-color/blob/master/.github/ISSUE_TEMPLATE.md

@anseki it seems that is missing a slash bar on path.
Is that normal ?
'C:\Users\ADKi.vscode\extensions\anseki.vscode-color-0.4.1\node_modules\electron-prebuilt\path.txt'
'C:\Users\Administrator.vscode\extensions\anseki.vscode-color-0.4.1\node_modules\electron-prebuilt\path.txt'

Hi @andreroggeri, thank you for the report.
Sorry, what do you mean? Which slash bar?
Also, Could you give me details?
https://github.com/anseki/vscode-color/blob/master/.github/ISSUE_TEMPLATE.md

Ah, I see. I understand slash bar 😄

I think the path for .vscode folder is wrong.
This
C:\Users\Administrator.vscode\extensions\anseki.vscode-color-0.4.1\node_modules\electron-prebuilt\path.txt
Should be:
'C:\Users\Administrator** \ **.vscode\extensions\anseki.vscode-color-0.4.1\node_modules\electron-prebuilt\path.txt'

I think that the slash is not the root cause, and the extension does not create the path.
Could you give me details?
https://github.com/anseki/vscode-color/blob/master/.github/ISSUE_TEMPLATE.md

I see.
I fixed this error by reinstalling the extension.
But now there is another problem (I'll report on another issue)

Unfortunately, no reply came from @DukeAnn, and I close this issue.


Limited reach of OUTCAR parameters

In OutcarTextParser body, the parameter extracts keywords up to 100 lines after the starting keyword.
A DFT+U test scheduled to be added, supersedes this limit, however.
Rather than just increasing the number of lines, could we instead add a stop flag to denote the end of the section?

I do not quite understand this parameter. Are you referrring to this
            Quantity(
                'parameters', r'Startparameter for this run:([\s\S]+?)\-{100}',
                str_operation=get_key_values, repeats=False, convert=False),

Yes: more specifically, I'm encountering (test) cases where the 100 limit isn't sufficient.

This is the end of section regex that I see from the files that I encountered. If you have another you can also add it like this:
            Quantity(
                'parameters', r'Startparameter for this run:([\s\S]+?)(?:\-{100}:__your_regex)',
                str_operation=get_key_values, repeats=False, convert=False),

Just be sure that this regex is not found before the 100 hyphens. You can also maybe perhaps reduce the number of hyphens to match your case?


Most userful Gems listed

[x] :page_facing_up:  Listed & :memo: described why those gems are useful for BR software factories
[x] those Gems must have documentation, like :octocat: GitHubPages
[x] :page_facing_up: List those which need to run :arrow_forward: rails g :install

comment why the gem is important

On the lib/generators/mirror/gem_installs.yml:page_facing_up:   are listed the gems which need to perform the
rails g gem_name:install


Pitch shifting with libsamplerate?

Hello icculus!
Not sure if you miss my supertuxkart team mail, but we've tried using your project as replacement for openal in stk-code, and we added a pitch-shfter ourselves.
It seems that actually "pitch shift without using resampling" is too slow for production usage (audio lags if too many sources requiring pitch shifting)..., so I came up with something like this with libsamplerate:
https://github.com/supertuxkart/stk-code/commit/33459e852c354a12bac2b082c643572a77d1eb34
(the original pitch shifter you posted on twitter is too slow)
What do you think about it? Or maybe you can add something to SDL_AudioStream API so that it can "live change" the dst / src ratio like libsamplerate, so we don't need to link against samplerate.

another quick question, possible to have smoother transition between 2 speakers?
Basically when some sound source is moving between center to left and right, the 2 speakers sound "digitally" instead of "analog" across 2 speakers (sound instantly changes between 2 speakers without fading in or out), while the official OpenAL has smoother experience

I haven't looked at your pitch shifter, but I think there was a concern that AL_PITCH had to operate in the frequency domain and not the time domain; that is, a sound can't be resampled to change pitch because it would finish more quickly, even if this generally doesn't matter for looping sounds...but I'd have to recheck the AL spec to see if that's actually true. The pitch-shifting code I wrote stinks for like 12 different reasons, so a better solution is definitely needed no matter what.
As for the transition: yes, this code also has problems. It's already an extremely naive approach, and on top of that, there's clearly some incorrect math somewhere causing that jarring transition. Fixing that is on the TODO list (but I'm going to split this comment into a second bug so there's an actual place we're tracking that change).

For the record libopenal pitch shift with resampling too (larger AL_PITCH will make the sound play faster with higher pitch)
Not sure if you prefer another issue, but just quick question, lets say a device has a 5.1 channel speaker, and if it plays audio with mojoal, will it utilize only 2 speaker out of 5 (6?) or all speakers will have sound output too, just half of it will have the same audio data?

Hey, I took a read at openAL Soft implementation and they reference this blog post in their source code: http://blogs.zynaptiq.com/bernsee/pitch-shifting-using-the-ft/ , at step "7. The Code" there's a good explanation on how to do such implementation that is very interesting.

Hey, I took a read at openAL Soft implementation and they reference this blog post in their source code:

So I implemented this (using the code from that same blog) for DragonRuby Game Toolkit, and never actually committed this to the main repo because I was waiting for it to get more testing. I'll commit this shortly.
Note that each source that changes AL_PITCH with this algorithm will allocate 32 kilobytes worth of buffers. If you don't change the pitch, it won't do this, though. I guess in modern times that isn't much, but it felt exorbitant to me!

I've pushed the code I mentioned in https://github.com/icculus/mojoAL/issues/2#issuecomment-1017878516, but I'm not super-happy with all the sin/cos/sqrt/etc calls it makes. It might be unavoidable with this approach, but it seems potentially quite expensive. But it's better than having no pitch support for now. I might end up adding a resampling implementation as a compile-time option, just to have the option for those that don't care about playback duration changing. Leaving this bug open for now.

I may be mistaken, but reading OpenAL's specification does not directly mention how the pitch suppose to work in description for the AL_PITCH, however, there's this paragraph in the description to AL_SEC_OFFSET on page 39:

This value is based on byte position, so a pitch-shifted source will have an exaggerated
playback speed. For example, you can be 0.500 seconds into a buffer having taken only
0.250 seconds to get there if the pitch is set to 2.0.

Does not that mean that the pitch implementation should modify duration, changing playback speed?

Hmm, let me look into this. The AL_PITCH section doesn't specify anything, and I think the SEC_OFFSET part was originally a Loki extension.
But honestly, it's clearly vague in the spec, at best, and I'd rather do this with sample rate conversion. I'll look into it.


Support joint force commands with the Battery plugin

Joint force commands were not checked in the battery plugin.
To test:

ign gazebo -v 4 examples/worlds/lift_drag_battery.sdf
Listen to the battery topic: ign topic -et /model/lift_drag_demo_model/battery/linear_battery/state
Run simulation.
The battery should be full and not discharging.
Start the propeller: ign topic -t "/model/lift_drag_demo_model/joint/rod_1_joint/cmd_force" -m ignition.msgs.Double  -p "data: 0.7"
The battery should start discharging.

Signed-off-by: Nate Koenig<EMAIL_ADDRESS>

Just one comment, other than that ready to approve.


Update update-cli.yml (AST-48101)

adds a condition to the Git LFS commit step to ensure that commits are only made if there are changes to commit

Checkmarx One – Scan Summary & Details – e23fbebc-36b3-4767-bcda-121a4ec9638e
New Issues

Severity
Issue
Source File / Package
Checkmarx Insight

Unpinned Actions Full Length Commit SHA
/update-cli.yml: 61
Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps...

Fixed Issues

Severity
Issue
Source File / Package

Unpinned Actions Full Length Commit SHA
/update-cli.yml: 60


S3AttachmentStore

This PR introduces a S3AttachmentStore which is an AttachmentStore implementation for storing attachments in S3 API compatible object storages
It should be possible to use this with IBM Cloud Object Storage as it supports S3 API.
Description
S3AttachmentStore uses Alpakka S3 Connector for making calls to S3. The object key is constructed in following form
<namespace>/<docId>/<name>

Where

namespace - Entity type in lowercase. For now only whiskentity is used with attachments

whiskentity
whiskauth
whiskactivation

docId - Document entity path
name - attachment name. It would be uuid

It supports following operations

readAttachment - Read is done in a streaming way using GET Object
attach - Stream is uploaded via multipart upload API where upload is done in chunks of 5 MB and then finally stitched together. This avoids buffering the whole stream on disk. So any upload would invoke 2+ remote calls to complete upload
deleteAttachments - This is done via List Objects v2 API to list object under prefix <namespace>/<docId> and then remove them via delete object api
deleteAttachment - This is done via single delete object api

Usage
To enable use of S3AttachmentStore following env variables need to be set

CONFIG_whisk_spi_AttachmentStoreProvider = whisk.core.database.s3.S3AttachmentStoreProvider
CONFIG_whisk_s3_bucket - Bucket name
AWS_ACCESS_KEY_ID - AWS Access Key ID. See Access Keys for details on key id and access key. Also see AWS Java SDK for details on how access keys are looked up
AWS_SECRET_ACCESS_KEY
AWS_REGION - . AWS Region name. See AWS Region Selection for details

See Alpakka S3 for more configuration details. In OpenWhisk setup the config are under whisk.s3.alpakka namespace (see s3-reference.conf for details)
Testing
All attachment related test  are consolidated in S3AttachmentStoreBehaviorBase and then there are suites to run it against various options

S3AttachmentStoreMinioTests - Performs testing against a Minio S3 Proxy. These test only need docker to be present.
S3AttachmentStoreAwsTests - Performs testing against S3. It requires following env variables to be configured. These are configured in travis settingsnfor master repo and in my fork. So are executed there.
a. AWS_ACCESS_KEY_ID
b. AWS_SECRET_ACCESS_KEY
c. AWS_REGION

We can also use S3Mock which is built on top of akka stack but then it may later pose problem if our dependency version diverge. So using Minio for now
Dependencies
S3 support pulls in following dependencies
$ ./gradlew :core:controller:dependencies
     \--- com.lightbend.akka:akka-stream-alpakka-s3_2.11:0.19
          +--- org.scala-lang:scala-library:2.11.12
          +--- com.typesafe.akka:akka-stream_2.11:2.5.12 (*)
          +--- com.typesafe.akka:akka-http_2.11:10.0.13 -> 10.1.1 (*)
          +--- com.typesafe.akka:akka-http-xml_2.11:10.0.13
          |    +--- org.scala-lang:scala-library:2.11.11 -> 2.11.12
          |    +--- com.typesafe.akka:akka-http_2.11:10.0.13 -> 10.1.1 (*)
          |    +--- com.typesafe.akka:akka-stream_2.11:2.4.20 -> 2.5.12 (*)
          |    \--- org.scala-lang.modules:scala-xml_2.11:1.0.6 (*)
          \--- com.amazonaws:aws-java-sdk-core:1.11.295
               +--- software.amazon.ion:ion-java:1.0.2
               \--- joda-time:joda-time:2.8.1

Add s3 support increases the size of controller.tar from 88 MB (92 jars) to 91 MB (97 jars). Following are version change and new jars being pulled in
14a15
> akka-http-xml_2.11-10.0.13.jar
22a24
> akka-stream-alpakka-s3_2.11-0.19.jar
30a33
> aws-java-sdk-core-1.11.295.jar
40a44
> ion-java-1.0.2.jar
52a57
> joda-time-2.8.1.jar
84c89
< scala-xml_2.11-1.0.5.jar
---
> scala-xml_2.11-1.0.6.jar

Below was the original dependency list which was trimmed down to previous one based on the assumption alpakka s3 client uses akk http stack. So commons http and jackson can be excluded. All tests pass with these dependencies removed
     \--- com.lightbend.akka:akka-stream-alpakka-s3_2.11:0.19
          +--- org.scala-lang:scala-library:2.11.12
          +--- com.typesafe.akka:akka-stream_2.11:2.5.12 (*)
          +--- com.typesafe.akka:akka-http_2.11:10.0.13 -> 10.1.1 (*)
          +--- com.typesafe.akka:akka-http-xml_2.11:10.0.13
          |    +--- org.scala-lang:scala-library:2.11.11 -> 2.11.12
          |    +--- com.typesafe.akka:akka-http_2.11:10.0.13 -> 10.1.1 (*)
          |    +--- com.typesafe.akka:akka-stream_2.11:2.4.20 -> 2.5.12 (*)
          |    \--- org.scala-lang.modules:scala-xml_2.11:1.0.6 (*)
          \--- com.amazonaws:aws-java-sdk-core:1.11.295
               +--- commons-logging:commons-logging:1.1.3 -> 1.2
               +--- org.apache.httpcomponents:httpclient:4.5.5 (*)
               +--- software.amazon.ion:ion-java:1.0.2
               +--- com.fasterxml.jackson.core:jackson-databind:<IP_ADDRESS> -> 2.7.7 (*)
               +--- com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:2.6.7
               |    \--- com.fasterxml.jackson.core:jackson-core:2.6.7 -> 2.7.7
               \--- joda-time:joda-time:2.8.1

TODO

[x] - Add test against actual S3 Bucket
[x] - Fix attachmentScheme name from s3s -> s3 (see akka/akka-http#2080)

Related issue and scope

[ ] I opened an issue to propose and discuss this change (#3450)

My changes affect the following components

[ ] API
[ ] Controller
[ ] Message Bus (e.g., Kafka)
[ ] Loadbalancer
[ ] Invoker
[ ] Intrinsic actions (e.g., sequences, conductors)
[x] Data stores (e.g., CouchDB)
[ ] Tests
[ ] Deployment
[ ] CLI
[ ] General tooling
[ ] Documentation

Types of changes

[ ] Bug fix (generally a non-breaking change which closes an issue).
[x] Enhancement or new feature (adds new functionality).
[ ] Breaking change (a bug fix or enhancement which changes existing behavior).

Checklist:

[x] I signed an Apache CLA.
[x] I reviewed the style guides and followed the recommendations (Travis CI will check :).
[x] I added tests to cover my changes.
[ ] My changes require further changes to the documentation.
[ ] I updated the documentation where necessary.

Codecov Report

Merging #3779 into master will increase coverage by 0.07%.
The diff coverage is 85.18%.

@@            Coverage Diff             @@
##           master    #3779      +/-   ##
==========================================
+ Coverage   74.91%   74.99%   +0.07%
==========================================
  Files         132      133       +1
  Lines        6180     6235      +55
  Branches      384      388       +4
==========================================
+ Hits         4630     4676      +46
- Misses       1550     1559       +9

Impacted Files
Coverage Δ

.../scala/src/main/scala/whisk/core/WhiskConfig.scala
92.06% <ø> (+0.06%)
:arrow_up:

...ala/whisk/core/database/s3/S3AttachmentStore.scala
85.18% <85.18%> (ø)

...isk/core/database/memory/MemoryArtifactStore.scala
95.74% <0%> (-0.71%)
:arrow_down:

Continue to review full report at Codecov.

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

Would need some suggestion on where to document steps for configuring S3AttachmentStore

This PR is now ready for review

Needs a PG

PG of commit aef88cf7980fe08059b0795ae1c3cdb947ada375 is 🔵


add proper service agent reporting

Build is failing. Are you working on a fix?

Yes, though this is a bizarre error.

Tests should be fixed now.

Current coverage is 66.57% (diff: 92.85%)

Merging #12 into master will decrease coverage by 0.02%

@@             master        #12   diff @@
==========================================
  Files            39         39
  Lines          2578       2579     +1
  Methods           0          0
  Messages          0          0
  Branches        465        465
==========================================
  Hits           1717       1717
  Misses          727        727
- Partials        134        135     +1

Powered by Codecov. Last update da730e8...f411495

Can you take a look @lookuptable?


Feature/load credentials from env

@emmenko @hajoeichler @svenmueller
Should we add some kind of priority to variables loaded from env? So they get taken automatically if present (no matter what other sources for credentials contain).

Did you have a look here?
https://github.com/sphereio/sphere-node-cli/blob/master/lib/utils/load-credentials.js

:+1:  That's nice, but it is not in the credentials utils sadly. Should I adapt either of the to codes to use the same env var names? If so which one? @svenmueller suggested to use CTP as a prefix since the product is called commerce tools platform and not sphere.

then i would rather vote for consistency and keep using the sphere prefix

@svenmueller @emmenko renamed the env variables and adapted code to be equivalent to what @emmenko did in the sphere-node-cli

:+1:

:+1: