Type error in Buffer.from()

Greetings folks! 👋
I'm getting a type error I can't explain.  I have some code like this:
function doStuff(foo: string|Buffer) {
  return Buffer.from(foo);
}

This gives me the compilation error:

Argument of type 'string | Buffer' is not assignable to parameter of type 'string'.  Type 'Buffer' is not assignable to type 'string'.

This is weird, because Buffer.from can accept a string or a Buffer.  The d.ts for node.js appears to check out:
    /**
     * Copies the passed {buffer} data onto a new Buffer instance.
     */
    from(buffer: Buffer): Buffer;
    /**
     * Creates a new Buffer containing the given JavaScript string {str}.
     * If provided, the {encoding} parameter identifies the character encoding.
     * If not provided, {encoding} defaults to 'utf8'.
     */
    from(str: string, encoding?: string): Buffer;

This kinda feels like a bug.  Am I missing something?  Thanks!
cc @ofrobots

@mhegazy I think this issue is not related to lib.d.ts. Buffer does not exist in Browser API, only in NodeJS. So I suppose fix should be added in DefinitelyTyped/DefinitelyTyped/types/node. What do you think?

@mhegazy I think this issue is not related to lib.d.ts. Buffer does not exist in Browser API, only in NodeJS. So I suppose fix should be added in DefinitelyTyped/DefinitelyTyped/types/node. What do you think?

Doh! thanks @a-tarasyuk for the correction. yes this should be done on the DT side. and looks like that you fixed it already in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/24966. thanks!

Sorry to be late to the game; I'm not a fan of the fix:

There's a definition for Buffer.from(string) in the Node v4 definition, but the API didn't exist until Node 5.
We're missing the second parameter for Buffer.from(string)
There is a commented out type name in the parameter list for Buffer.from
The methods docs are worse than their predecessor.

Do we really need to muddy the codebase when the workaround is so simple? It seems like the right thing to do is ask someone to "me too" the original issue and add the 3LOC workaround:
function doStuff(foo: string|Buffer) {
  // https://github.com/Microsoft/TypeScript/issues/14107
  if (typeof foo === 'string') {
    // Now my code can even handle strings that were in hex64,
    // not ascii.
    foo = Buffer.from(foo/*, optEncoding */);
  }
  // do real stuff
}

It isn't like this is a big deal for us or anything, just found it to be a minor inconvenience and something I should probably report :)  I'm perfectly happy to wait for https://github.com/Microsoft/TypeScript/issues/14107 to land.

Sorry, I didn't mean to bite off anyone's head either. I'm really glad you reported the issue and I hope that the bug leaves a paper trail so more people can add pressure to #14107; the TypeScript team has got loads on their plate and +1s help them balance priorities.
@a-tarasyuk; would it be possible to revert since the fix added bugs? @JustinBeckwith should be able to work around with the if (typeof foo === 'string') clause and it will actually lead to more explicit and self documenting code if he includes the encoding he wants.

@inlined sure, I can make PR. The fix is ready just need to get approve from @mhegazy, and make PR on GitHub. Does it work for you?

Yeah. If @mhegazy is onboard
On Mon, Apr 16, 2018 at 12:40 AM Alexander T<EMAIL_ADDRESS>wrote:

@inlined https://github.com/inlined sure, I can make PR. The fix is
ready just need to get approve from @mhegazy https://github.com/mhegazy,
and make PR on GitHub. Does it work for you?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/Microsoft/TypeScript/issues/23155#issuecomment-381507823,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABe1j0ysf3PlWm1EhgBpipGxXKwLh8vEks5tpEsAgaJpZM4THpfV
.

I do not think the change is bad really. The order of the overloads can be fixed to address the issues you are referring to earlier. But in general it is better to use union types than having multiple overloads.

There is a commented out type name in the parameter list for Buffer.from

@inlined I expect you refer to TypedArray. The problem here is that this is a ES6 type and if we change node typings to require lib ES6 we break a lot use code (I did this once....). But Node supports TypedArray here so you can see this a placehoder for the future.
By the way, which exact use is the problem now? I locally added Buffer.from("ffo", "utf-8") in the tests and no complain from typescript. Which way do you call Buffer.from() and which typescript version?

Looks like I've overreacted to everything. I retract my previous comments. Thanks everyone for being patient with me here.

The problem here is that this is a ES6 type and if we change node typings to require lib ES6 we break a lot use code (I did this once....).

Is it not reasonable to expose the type in types/node/v8 and remove the comment elsewhere?

By the way, which exact use is the problem now? I locally added Buffer.from("ffo", "utf-8") in the tests and no complain from typescript.

Yup... A total facepalm moment on my part. I missed the one overload after the GitHub  diff collapse.

It's also available in NodeJS 4

Interesting; the v4 docs and 4.5 release notes agree. The latest docs misleadingly say "added in 5.10". Should we not be trusting those docs when reviewing this codebase?

Is it not reasonable to expose the type in types/node/v8 and remove the comment elsewhere?

I found that my last statement in this is outdated - nodejs typings refer to lib.es6.d.ts already so Int8Array,... are available.
Therefore I think it would be possible to add | Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array or define a type TypedArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array.
There are a few other locations where TypedArray is commented so they should be adapted also if someone creates a PR for this.

Interesting; the v4 docs and 4.5 release notes agree. The latest docs misleadingly say "added in 5.10". Should we not be trusting those docs when reviewing this codebase?

Well, I did a fast try and then it was clear the v4 doc is correct. I expect this is a side effect of how NodeJs backports new APIs. First they land on master and get released (e.g. in 5.10). The docs on master tell exactly this. A few weeks later the backport is done (for selected features only) by merging the relevant changes to v4 branch - but docs on master are not updated automatically.
I think it's up to us to create a PR towards node doc to fix this :grin:


Does Changelog works with github action?

    steps:
      - name: PR Agent action step
        id: pragent
        uses: Codium-ai/pr-agent@main
        env:
          OPENAI_KEY: ${{ secrets.OPENAI_KEY }}
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          PR_UPDATE_CHANGELOG.PUSH_CHANGELOG_CHANGES: true

Still on opening a new PR, no change log is generated. Am I missing something?

You cannot run it automatically on new PR in github action.
Review thoroughly the documentation:
https://qodo-merge-docs.qodo.ai/usage-guide/automations_and_usage/#github-action
For online commenting, github action does work


More flexible currency conversion

Hi folks!
Really nice package! And..
It will be good to pass own promise function when calling convert method.

Hey Nemmo, thank you for the support!
Can you tell me a bit more about your use case and the expected behavior?

For example I want to get the currency information from our database, or make a soap request instead of rest

Oh, I see. This would involve letting people create their own getExchangeRate method and pass it on. I can't promise it will happen for now but I'll keep the issue open in case someone wants to PR this and/or for me later.
In the meantime, I would suggest creating your own method around Dinero and the Calculator service.

Actually +1 👍  for this feature request, that would be cool especially since in some app the rate is loaded once and cached for a certain duration, reducing the number of HTTP requests when using this method repeatedly.
If I can suggest, it would be cool to allow for an alternative to options.endpoint by specifying a customPromise which is expected to produce the same output, parseable through the existing options.propertyPath.

convert(currency, options) {
      options = Object.assign({}, globalExchangeRatesApi, options)
      // console.log(`options\n${JSON.stringify(options, null, 2)}`)
      return (options.endpoint instanceof Function
      ? options.endpoint.constructor.name === 'AsyncFunction' // can probably be improved
        ? options.endpoint(options)
        : Promise.resolve(options.endpoint(options))
      : CurrencyConverter(options).getExchangeRate(this.getCurrency(), currency))
        .then(rate => {
          assert(
            !isUndefined(rate),
            new TypeError(
              `No rate was found for the destination currency "${currency}".`
            )
          )
          return create.call(this, {
            amount: calculator.round(
              calculator.multiply(this.getAmount(), parseFloat(rate)),
              options.roundingMode
            ),
            currency
          })
        })
        .catch(console.error)
    }

@Roms1383 @james-ff Just opened a PR for it so you could get a look, I'm interested in your feedback before I merge it: https://github.com/sarahdayan/dinero.js/pull/49

Looks good to me!
Is propertyPath: 'rates.{{to}}' required, or optional if the default object structure is used? Either way is ok, just curious.

@james-ff There currently is not default structure, one always has to provide a propertyPath.

@james-ff Just pushed the change 🔥

:tada: This issue has been resolved in version 1.6.0 :tada:
The release is available on:

npm package (@latest dist-tag)
GitHub release

Your semantic-release bot :package::rocket:


MediaQuery.of() called with a context that does not contain a MediaQuery.

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    ScreenUtil.instance = ScreenUtil(width: 750, height: 1334)..init(context);
    return MaterialApp();
  }
}

I don't think that it's necessary to use context,
you can get screen width like this,
import 'package:flutter/material.dart';
import 'dart:ui';

final num vh = MediaQueryData.fromWindow(window).size.height;

Dart:ui can't get screen data in release mode in time .
But if you have a good way to welcome sharing

Dart:ui can't get screen data in release mode in time .
But if you have a good way to welcome sharing

I've tried, Dart:ui can get screen data in release mode，
Do you think it is async？

Here's my environment
• Flutter version 1.5.4-hotfix.2
• Framework revision 7a4c33425d (9 weeks ago), 2019-04-29 11:05:24 -0700
• Engine revision 52c7a1e849
• Dart version 2.3.0 (build 2.3.0-dev.0.5 a1668566e5)

Maybe I should try again at 1.5.4, thank you for your suggestion.

I don't know why my test was good before.
But , I tested it a few times and found that it didn't work.

what's wrong?

Sometimes it works, but sometimes it doesn't work.Do you think there is a problem with the code above?

I think when your home page draw, window's width shouldn't be zero

It seems that it is asynchronous, so I am not going to use this method for the time being.

But this method doesn't work at the root app class, it work at app's home class

My phone is rooted and it works fine, I don't know what your problem is.

no other problem and you can try print width in root main method

I guess what you mean is to get the screen data in MyApp? This is not possible, because it is initialized in the home, so the data can only be obtained after the initialization method in the home. If I am wrong, mostShow the code you want to implement

all right, use context config your plugin, It doesn't affect my use

Look at this article maybe helpfull for you
Flutter Error: MediaQuery.of() called with a context that does not contain a MediaQuery


Installation of module node-red-contrib-lwm2m failed

Dear Dbaba,
I have an issue with installation of node-red-contrib-lwm2m from a "Palette - Install".
Node-RED version: v0.19.4
Node.js  version: v4.2.6
npm version 3.5.2
Linux 4.15.0-38-generic x64 LE
lwm2m plugin version: 1.3.0
This is a clean install, i have just tested it on clean Ubuntu 16.04 machine (have just installed node-legaсy, npm, node-red).
The same issue was reproduced on Azure VM with the same error.
Could you have a look, please?
Thanks!
Andrey
logs.zip

Ah, okay.
The issue was fixed by installing latest Nodejs version
I had  v4.2.6 - after installing v8.12.0 installation of  node-red-contrib-lwm2m was successful.
The issue can be closed.


Fix escape key not working to close compose edit state.

This was due to event handlers being lost when restoring a message edit state. To avoid it, we recreate the form and attach event handlers to it which also correctly update the current state of the edit form buttons based on settings.
Just edit a message -> go to a different narrow -> click browser back button -> focus on the edit form and try to press escape (it doesn't work)
discussion: https://github.com/zulip/zulip/pull/29383#discussion_r1546776263

Merged this after the one tweak noted above; I guess I forgot about https://github.com/zulip/zulip/pull/30086#discussion_r1600512139, but it doesn't seem super important and probably will come up naturally when moving this file to TS anyway.


Provide multiple permission when adding role through admin service

In [1] details should be added on how to give permission to a role and this should be addressed in the form of a real use case. E.g. How do i create a role with read permission to resource x and write permission to resource y. Here this should be mapped to a reference and all permissions that can be granted through the api should be documented.
[1] https://docs.wso2.com/display/IS540/Managing+Users+and+Roles+with+APIs#ManagingUsersandRoleswithAPIs-addRole()

Thank you for your contribution!
We are closing this issue since it has not been prioritized for a long time. Chances are that it has already been solved in more recent versions. If not, we will be re-evaluating this when it becomes a priority.


Add format parameter to /genome_region

Hi @manulera
Sorry, I planned to make this a pull request, but I accidentally push it to master instead:
https://github.com/pombase/allele_qc/commit/ef5789a9dff0e01198c73b844798cf0cd659ca36
This change is so we can download as EMBL format.  What do you think?
Maybe the format should be "genbank" by default?

This change is so we can download as EMBL format.

Unfortunately I get "Internal Server Error" if the format is "embl".  It works fine with "genbank" and "fasta".
INFO:     <IP_ADDRESS>:41140 - "GET /genome_region?systematic_id=SPCC18B5.11c&format=embl&upstream=0&downstream=0 HTTP/1.1" 500 Internal Server Error
ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/uvicorn/protocols/http/httptools_impl.py", line 419, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
  File "/usr/local/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__
    return await self.app(scope, receive, send)
  File "/usr/local/lib/python3.10/site-packages/fastapi/applications.py", line 270, in __call__
    await super().__call__(scope, receive, send)
  File "/usr/local/lib/python3.10/site-packages/starlette/applications.py", line 124, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/usr/local/lib/python3.10/site-packages/starlette/middleware/errors.py", line 184, in __call__
    raise exc
  File "/usr/local/lib/python3.10/site-packages/starlette/middleware/errors.py", line 162, in __call__
    await self.app(scope, receive, _send)
  File "/usr/local/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 79, in __call__
    raise exc
  File "/usr/local/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 68, in __call__
    await self.app(scope, receive, sender)
  File "/usr/local/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 21, in __call__
    raise e
  File "/usr/local/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.10/site-packages/starlette/routing.py", line 706, in __call__
    await route.handle(scope, receive, send)
  File "/usr/local/lib/python3.10/site-packages/starlette/routing.py", line 276, in handle
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.10/site-packages/starlette/routing.py", line 66, in app
    response = await func(request)
  File "/usr/local/lib/python3.10/site-packages/fastapi/routing.py", line 235, in app
    raw_response = await run_endpoint_function(
  File "/usr/local/lib/python3.10/site-packages/fastapi/routing.py", line 161, in run_endpoint_function
    return await dependant.call(**values)
  File "/api/./api.py", line 401, in get_genome_region
    SeqIO.write(rv, fp, format)
  File "/usr/local/lib/python3.10/site-packages/Bio/SeqIO/__init__.py", line 524, in write
    count = writer_class(handle).write_file(sequences)
  File "/usr/local/lib/python3.10/site-packages/Bio/SeqIO/Interfaces.py", line 234, in write_file
    count = self.write_records(records, maxcount)
  File "/usr/local/lib/python3.10/site-packages/Bio/SeqIO/Interfaces.py", line 208, in write_records
    self.write_record(record)
  File "/usr/local/lib/python3.10/site-packages/Bio/SeqIO/InsdcIO.py", line 1415, in write_record
    self._write_the_first_lines(record)
  File "/usr/local/lib/python3.10/site-packages/Bio/SeqIO/InsdcIO.py", line 1245, in _write_the_first_lines
    raise ValueError("Cannot have spaces in EMBL accession, '%s'" % accession)
ValueError: Cannot have spaces in EMBL accession, '<unknown id>'

I don't know if this is the correct fix, but it seems to work: 09efb37ba875b909e6c7b480e17a92255f68975f

Looks sensible, BioPython is extremely pedantic so anything that circumvents those kind of restrictions makes me happy (it won't even tolerate sequence ids that are too long...)

BioPython is extremely pedantic so anything that circumvents those kind of restrictions makes me happy

:-)
On the plus side the GenBank and EMBL output BioPython produces seem to be correct.  Or at least they are correct enough to be read by Artemis.

We could make this accept a set of pre-defined options (embl, fasta, genbank). I can do it easily. Alternatively we can leave it as is and close. Let me know.

We could make this accept a set of pre-defined options (embl, fasta, genbank).

I think that's a good idea.  Thanks.

Done, I will close with this then


Give PEAR it's own ensure.

php::pear currently defaults to ensure "$php::ensure". This causes some
trouble once versions are specified as PHP could be on 5.6 and PEAR at 1.9.

Good catch! Thanks! :beers:


Suggestion : raw hex view in assembler

Not sure how doable this is, but it would be nice to have a column to the left of the assembler window with the raw hexadecimal corresponding to each line.

I have a plan for this idea, but not in the assembler so you can see live changes. That is not really do-able at the moment.
https://github.com/Col-E/Recaf/issues/244 - My plan is to have a read-only window that is similar to the assembler.
It will be a while before I can get around to fully implementing this. More info in the linked issue.


Add support Azure

fixed with one resource now in https://github.com/GoogleCloudPlatform/terraformer/pull/227


Using typeof for Type args wont work

Describe the bug
A clear and concise description of what the bug is.
Hello, I'm trying to create some kind of a default resolver, before moving to Typegraph I just did this buy creating a resolver on the fly, now with classes and types this does not seem to work.
To Reproduce
In my Type (Action) file:
@ObjectType()
...
}

@ObjectType()
export class ActionResult {
...
}

@ArgsType()
export class ActionArgs {
...
}

In my Default Resolver  file:

export default async (name) => {
  const plural = pluralize(name).toLowerCase();

  const { [name]: Entity, [`${name}Result`]: ResultEntity, [`${name}Args`]: EntityArgs } = await import(`../schemas/${name}`);

  @Resolver(Entity)
  class DefaultResolver {

    @Query(returns => ResultEntity)
    async [plural](@Args() args: typeof EntityArgs) {

    }
  }

  return DefaultResolver;
};

For this file I get the error:

UnhandledPromiseRejectionWarning: Error: You need to provide explicit type for DefaultResolver#actions parameter #0 !
--

Expected behavior
A clear and concise description of what you expected to happen.
To work as normal.
Logs
If applicable, add some console logs to help explain your problem.
You can paste the errors with stack trace that were printed when the error occured.

(node:12576) UnhandledPromiseRejectionWarning: Error: You need to provide explicit type for DefaultResolver#actions parameter #0 !                at Object.findType (G:\devl\characters\node_modules\type-graphql\dist\helpers\findType.js:17:15)                                              at Object.getParamInfo (G:\devl\characters\node_modules\type-graphql\dist\helpers\params.js:9:49)                                             at G:\devl\characters\node_modules\type-graphql\dist\decorators\Args.js:9:120                                                                 at G:\devl\characters\server\apollo\resolvers\defaultResolverFactory.ts:12:37                                                                 at DecorateProperty (G:\devl\characters\node_modules\reflect-metadata\Reflect.js:553:33)                                                      at Object.decorate (G:\devl\characters\node_modules\reflect-metadata\Reflect.js:123:24)                                                       at __decorate (G:\devl\characters\server\apollo\resolvers\defaultResolverFactory.ts:4:92)                                                     at exports.default (G:\devl\characters\server\apollo\resolvers\defaultResolverFactory.ts:31:5)                                                at processTicksAndRejections (internal/process/task_queues.js:85:5)                                                                           at async Promise.all (index 0)                                                                                at Object.exports.createSchema (G:\devl\characters\server\apollo\resolvers\index.ts:8:16)                                                     at Object.exports.default (G:\devl\characters\server\apollo\apollo.ts:11:45)                                                                  at start (G:\devl\characters\server\index.ts:49:3)
--

Enviorment (please complete the following information):

OS: Windows 10
Node 12
Package version: latest
TypeScript version 3.4.1

You can't use typeof, TypeGraphQL need a runtime value that is a class. For @Args() decorator you have to use a @ArgsType() class as a type.
@Args() args: EntityArgs

@ArgsType()
export class EntityArgs {
  // ...fields here
}

I See, well I tried this originaly and it did not work:
@ArgsType()
export class EntityArgs {
  // ...fields here
}

And in the code I tried

export default async (name) => {
  const plural = pluralize(name).toLowerCase();

  const { [name]: Entity, [`${name}Result`]: ResultEntity, [`${name}Args`]: EntityArgs } = await import(`../schemas/${name}`);

  @Resolver(Entity)
  class DefaultResolver {

    @Query(returns => ResultEntity)
    async [plural](@Args() args: EntityArgs) {

    }
  }

  return DefaultResolver;
};

But then I got the error EntityArgs is a value but is being used as a type which it is a type, but I guess Typescript cant see that as I dynamic import it.

Can you create a minimal reproducible example? I think that the dynamic import with calculated prevent it from being statically typechecked.
Why do you do this kind of weird importing the schema?

Closing for a housekeeping purposes 🔒


Adds async tests for propagation and error handling

This adds async tests for thread-propagation and error handling. In
order to unpin tests from servlet 3.0, some redundant tests were
removed. This avoids creating different test modules based on servlet
version.

first commit is from #366

It all looks like a good approach IMHO.

thanks @llinder I rebased this and fixed a broke test in jersey 2.x (wasn't pulling in the right dep for servlet 3.x support). will merge on green


ConstantOfShape Verifier Tests

Can one of the admins verify this patch?

Can one of the admins verify this patch?

Can one of the admins verify this patch?

@jenkins-droid test this please

Can one of the admins verify this patch?

@jenkins-droid test this please

Can one of the admins verify this patch?

@jenkins-droid test this please

Jenkins Linux ppc64le Build #3987 [push] ConstantOfShape Verifier... started at 17:02

Jenkins Linux s390x Build #4866 [push] ConstantOfShape Verifier... started at 16:58

Jenkins Linux amd64 Build #4850 [push] ConstantOfShape Verifier... started at 15:58

Jenkins Linux s390x Build #4866 [push] ConstantOfShape Verifier... passed after 46 min

Jenkins Linux ppc64le Build #3987 [push] ConstantOfShape Verifier... passed after 55 min

Jenkins Linux amd64 Build #4850 [push] ConstantOfShape Verifier... passed after 1 hr 1 min


Feature/GitHub actions base

I deleted the types part of the pull request, as adding the -edited did not trigger the actions. They were now triggered


perf: load aws cfg lazily

Speed up init by lazily loading the AWS config.
The config is only used when the secrets manager or an acm certificate is configured.

run docs-build


Add more information for label

Add more information for label

what about the
control-label.tsx ?

@miafan23 added now also control-label


Quote label and selector values

Follow up on #503 to quote labels and selectors of all existing resources:
Labels like foo: true are invalid, so we need to quote them.

/assign @pierDipi


Uncaught TypeError: Cannot set property 'scrollTop' of null

Hi i'm encountering this issue recently:
"react": "^16.10.2",
"@material-ui/core": "^4.5.1",
Probably related to this line of code. Maybe something within React changed:

index.js:2534 Uncaught TypeError: Cannot set property 'scrollTop' of null
at e.scrollTo (index.js:2534)
at e. (index.js:2592)
at callCallback (react-dom.development.js:13936)
at commitUpdateEffects (react-dom.development.js:13976)
at commitUpdateQueue (react-dom.development.js:13964)
at commitLifeCycles (react-dom.development.js:21965)
at commitLayoutEffects (react-dom.development.js:25266)
at HTMLUnknownElement.callCallback (react-dom.development.js:363)
at Object.invokeGuardedCallbackDev (react-dom.development.js:412)
at invokeGuardedCallback (react-dom.development.js:465)
at commitRootImpl (react-dom.development.js:25002)
at unstable_runWithPriority (scheduler.development.js:818)

It seems due to a change in MUI paper doesn't have the role="document" anymore.
I fixed it in my app by changing the querySelector to  (".MuiPaper-root")

Thanks for putting in the legwork, @masbaehr. I'll see if I can find a more elegant way to fix it and publish a new release as soon as I can.

@masbaehr This should be fixed now


fix older java version detection

Improved the regex for old java version detection.
For Java version like 1.7.0_145,  the current regex will still recognize it as Java 1.4 or 1.5

Thanks @branky . We already discovered and fixed this issue in our next release (available shortly).

Thanks, closing the pull request now.


Expand component catalog

Add more components from @mui/material and studioPropTypes to support them

Duplicate https://github.com/mui/mui-toolpad/issues/78


Add parameter for terraform executable (for compatibility with OpenTofu)

I've added a new global parameter --executable (or short -e), to set the path or name of the executable to be executed in the terraform commands. Therefore, this tool can also be used with OpenTofu or similar forks of Terraform.
The default value for the flag is read from the TFTARGET_EXECUTABLE environment variable, so that users can set their desired executable in their shell profiles.
Otherwise, the PATH environment variable is checked first for the terraform executable and then for the tofu executable. If one of them is found, it will be used as default for the parameter. If none is found, the program will exit with an error.
Please let me know what you think of this change.

Thanks I'll check in this weekend.

Thank you very much <3


Feat(web): Introduce new Header with subcomponents #DS-424

Header and HeaderDialog (formerly Header__dialog) no longer share the same markup. To create a responsive navigation, you must duplicate your nav and place it into the action slots in both Header (for desktop) and HeaderDialog (for mobile).
In other than the simplest use cases, Header now requires a temporary Header--composed modifier class. The existing compositions of Header—without the modifier class—are deprecated and will be removed in next major version. Simple variants of Header (that only contain a logo) are NOT affected.
Experimental RTL Support

A note to myself:

[ ] Update the commit message body after it has turned up composed modifier is needless.

There is a default focus color after using the Escape key to close the dialog.

There is a default focus color after using the Escape key to close the dialog.

@literat That's correct behavior: by hitting the escape key, you are telling the browser you want to use keyboard navigation, and the browser highlights the place of your focus.

That's correct behavior

I mean if the color is correct...

That's correct behavior

I mean if the color is correct...

@literat Oh, I see. Looks like we haven't covered the focus style for elements other than inputs yet. The color is indeed coming from user agent styles. We should consult the design how to approach it, I believe.


FAQ - Transnational exposure logging - meaning of date

Where to find the issue

https://github.com/corona-warn-app/cwa-website/pull/764#issuecomment-757153580

Describe the issue

Suggested change

also update status date
Finland not showing up  https://github.com/corona-warn-app/cwa-website/pull/764#issuecomment-757683864

The date shown is the date when feeding starts.

The date shown is the date when feeding starts.

@dsarkar

The date shown is the date when feeding starts.

It makes sense to use this date, because if somebody has visited one of the countries the information tells a user from what date they are potentially covered by Diagnosis Keys from that country. (Of course, for the keys to become usable the country's data also has to be pulled.)
I'm wondering if it is necessary to keep the dates if they are more than 14 days in the past because according to https://www.coronawarn.app/assets/documents/cwa-privacy-notice-en.pdf earlier data, also on the EFGS, is deleted after 14 days. So the date becomes irrelevant after 14 days. If the date is within the last 14 days it shows how much of the period is covered by active Diagnosis Keys. I understand though that it is easier just to leave the dates in the list instead of removing them when they are older.

@dsarkar

The date shown is the date when feeding starts.

It makes sense to use this date, because if somebody has visited one of the countries the information tells a user from what date they are potentially covered by Diagnosis Keys from that country. (Of course, for the keys to become usable the country's data also has to be pulled.)
I'm wondering if it is necessary to keep the dates if they are more than 14 days in the past because according to https://www.coronawarn.app/assets/documents/cwa-privacy-notice-en.pdf earlier data, also on the EFGS, is deleted after 14 days. So the date becomes irrelevant after 14 days. If the date is within the last 14 days it shows how much of the period is covered by active Diagnosis Keys. I understand though that it is easier just to leave the dates in the list instead of removing them when they are older.

@dsarkar
Finnland is now showing in the list.
So I think this issue can be closed.

@dsarkar
Finnland is now showing in the list.
So I think this issue can be closed.

Unfortunately the country name for Finland in the Android app has the German and English renderings the wrong way around. See https://github.com/corona-warn-app/cwa-app-android/issues/2069.
The use of the country name in the FAQs looks correct for English and German though! 👍

Unfortunately the country name for Finland in the Android app has the German and English renderings the wrong way around. See https://github.com/corona-warn-app/cwa-app-android/issues/2069.
The use of the country name in the FAQs looks correct for English and German though! 👍


Replace column definitions into more flexible structure

This PR replaces the stacked list for column specs into a dict. This makes it easier to extend.

All tests pass, but there is a problematic issue with the temporary pickle files in the front-end. This needs to be fixed before merging.


Create structure for 3rd-party connectors

Focusing on CMS for Contentful

This is done, we already have a working example with Contentful. We just have to apply it to all others.


Remove roboto from source

Proposed changes
Having the Roboto font inside the project is making it difficult to use the materialize-css npm package and it is making the repo unnecessary big. About ~1.5mb. Adding a guide how to obtain the font from a CDN or how to include it via @font-face would be the way to go.
Fixes: #2217

[x] Add instructions (jade)
[x] Remove fonts/ & dist/fonts
[x] Edit Gruntfile.js
[x] Modify package.js
[x] Edit templates
[x] Remove _roboto.scss and modify variables
[x] Remove from bower.json

Closes https://github.com/Dogfalo/materialize/issues/4797
Types of changes

[ ] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[x] Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

[x] I have read the CONTRIBUTING document.
[x] My change requires a change to the documentation.
[x] I have updated the documentation accordingly.
[ ] I have added tests to cover my changes.
[x] All new and existing tests passed.

@DanielRuf any idea why the test fails? I can't spot any json error inside the package.json :/

Trailing comma in object at 24:3
https://github.com/tomscholz/materialize/blob/285c10152a75dafa9153b8db9a87f055aa979927/package.json#L23

See the actual error when linting with https://jsonlint.com
Error: Parse error on line 23:
...jquery": "^3.2.1",	},	"engine": "node
----------------------^
Expecting 'STRING', got '}'

@DanielRuf thx

This breaks building with webpack, why do this?
ERROR in ./node_modules/materialize-css/sass/materialize.scss
Module build failed: ModuleNotFoundError: Module not found: Error: Can't resolve '../fonts/roboto/Roboto-Thin.woff2' in 'C:\Source\frontend\node_modules\materialize-css\sass'

@IAMtheIAM did you test https://github.com/tomscholz/materialize/tree/remove-roboto?

Any updates on this?
@Dogfalo @acburst

I guess a merge squash would make sense here...

@DanielRuf I did test https://github.com/tomscholz/materialize/tree/remove-roboto and it compiles successfully. Will this be merged to master soon?

I dont know

This looks good… what's holding it back?

I don't know

Oh, I see… this repo has 150 open PRs… I guess they don't monitor their contributions much.

@peabnuts123 They do monitor it, but they have a lot to review when its comes to PRs, Issues, and their own code enhancements. They'll get to it, its in the next release milestone.

@IAMtheIAM Haha ^^ I originally created that milestone. My guess is that this will come with one of the next releases, but I can't say for sure.

@Dogfalo Would this get merged, when I make the PR against the v1-dev branch?

@tomscholz Yes I will merge it if it is made on the v1-dev branch

Got it

Please link the new PR here when it is made

@tomscholz Maybe you have been busy, but I didn't notice a PR. No problem though, I will go through now and remove the files.

@Dogfalo Thats cool. Yes I have been very busy lately, sorry for not posting any updates


make getting errno a native function

This is an alternative to #284 /cc @d3m3vilurr
It removes the errno.js file entirely.

I already tried same work on the #284, and also got same problem.
errno will cleare at we call v8 handle for read this value on the windows environment
I think, v8 interfaces use some system APIs, errno overwrited their check bit value between v8 interface boundary.
So, I was reverted some errno.js source code for the windows system... :(

Yup I remember now. Ok, we'll land your PR then.


no longer render label by default in ActiveField::hiddenInput()

Q
A

Is bugfix?
no

New feature?
no

Breaks BC?
no

Tests pass?
yes

Fixed issues
#2990

hi @samdark
this PR set to 2.1.x milestone, is due to changes in behaviour the way hiddenInput() on 2.0?

@agungsijawir yes

Merged c64cfa9373867ec72638de4e3e6b97ef4036b481

Thank you


Update: Adding a syntax and a grammar correction

...that prepares computers the world ...
Correction:
... that prepares, computers of the world ...

I think the current text is correct. But this is also a very old article so I'd leave it alone in any case. Thanks anyway :-)


use default app when appName is missing

when appName is missing and there's only one app installed, use that app as default appName

@billylkc fill in our discussion regarding referencing the current VM

Ready for testing in 0.1.7

works


Add Horde/Alliance header lines

Go to https://github.com/WyriMaps/php-x-headers/tree/master/src
Select Horde.php or Alliance.php
Add a new header in the format 'X-TOPIC' => 'CONTENTS', where TOPIC is the topic (Thrall, Orgrimmar etc etc) and where CONTENTS is a quote/fact/etc about TOPIC.
Save changes and create pull request

OR

Go to https://github.com/WyriMaps/php-x-headers/tree/master/src
Create new Faction.php file (where Faction is the faction you want to create headers for)
Fill file with https://gist.github.com/WyriHaximus/4b81d27b73f6f4b1a953d3c923ca3e3d
Add a new header in the format 'X-TOPIC' => 'CONTENTS', where TOPIC is the topic (Worgen, Gilneas etc etc) and where CONTENTS is a quote/fact/etc about TOPIC.
Save changes and create pull request

These headers will be used in the upcoming rebuild of WyriMaps.net and WoW-Screenshots.net. Also I'll keep this issue open so others can pick up on it and create their own PR's

I'll add some


[Enhancement]: Git version control infrastructure changes

[ ] https://github.com/appsmithorg/appsmith/issues/14498

@sidhantgoel hope the solution for this is clear. Please reach out if there is any doubt


Query doesn't return the right object type

Hello,
i have a problem with the instance returned by the query operation (also with get op):
const store: DynamoStore<OrderModel> = new DynamoStore<OrderModel>(OrderModel);
const getOrder = await store
   .query()
   .index(indexName)
   .wherePartitionKey(order.storeOrderId)
   .whereSortKey().eq(order.selectedStoreId)
   .execSingle();

my expectation was that the type of the object returned from the above query should be the one declared during the store definition, but i'm getting a simply js Object instead of an OrderModel, any idea?
Thank you.

Hi @mattia85
This is how the library is supposed to work, we don't create instances of the provided model class. So an instanceof check will always return false.  The model class is only defined for metadata purposes, any business logic should be provided in pure helper methods.

ok @michaellieberherr, thanks for clarifying that.


Data Science - Iteration 1 (second push for Zamir)

@cstavitsky Nice work on this, Chris. You are free to move on, but definitely focus on testing the rest of the way through Level Up.


can not install components in ambari

hi
I want install odp cluster with componnets such as "zookeeper"
I had error such as bellow
I am using Rocky Linux 8 with odp1.2 stack
stderr:
Command aborted. Reason: 'Server considered task failed and automatically aborted it'
stdout:
2023-12-31 13:13:05,487 - Stack Feature Version Info: Cluster Stack=1.2, Command Stack=None, Command Version=None -> 1.2
2023-12-31 13:13:05,500 - Group['hadoop'] {}
2023-12-31 13:13:05,502 - User['zookeeper'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': ['hadoop'], 'uid': None}
2023-12-31 13:13:05,565 - User['ambari-qa'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': ['hadoop'], 'uid': None}
2023-12-31 13:13:05,588 - File['/var/lib/ambari-agent/tmp/changeUid.sh'] {'content': StaticFile('changeToSecureUid.sh'), 'mode': 0555}
2023-12-31 13:13:05,591 - Execute['/var/lib/ambari-agent/tmp/changeUid.sh ambari-qa /tmp/hadoop-ambari-qa,/tmp/hsperfdata_ambari-qa,/home/ambari-qa,/tmp/ambari-qa,/tmp/sqoop-ambari-qa 0'] {'not_if': '(test $(id -u ambari-qa) -gt 1000) || (false)'}
2023-12-31 13:13:05,628 - Skipping Execute['/var/lib/ambari-agent/tmp/changeUid.sh ambari-qa /tmp/hadoop-ambari-qa,/tmp/hsperfdata_ambari-qa,/home/ambari-qa,/tmp/ambari-qa,/tmp/sqoop-ambari-qa 0'] due to not_if
2023-12-31 13:13:05,661 - Repository for ODP/1.2/ODP-<IP_ADDRESS>-21 is not managed by Ambari
2023-12-31 13:13:05,662 - Repository[None] {'action': ['create']}
2023-12-31 13:13:05,685 - Package['unzip'] {'retry_on_repo_unavailability': False, 'retry_count': 5}
2023-12-31 13:13:08,918 - Skipping installation of existing package unzip
2023-12-31 13:13:08,918 - Package['curl'] {'retry_on_repo_unavailability': False, 'retry_count': 5}
2023-12-31 13:13:12,754 - Skipping installation of existing package curl
2023-12-31 13:13:13,049 - call[('ambari-python-wrap', u'/usr/bin/odp-select', 'versions')] {}
2023-12-31 13:13:13,148 - call returned (1, 'Traceback (most recent call last):\n  File "/usr/bin/odp-select", line 499, in \n    printVersions()\n  File "/usr/bin/odp-select", line 338, in printVersions\n    for f in os.listdir(root):\nOSError: [Errno 2] No such file or directory: '/usr/odp'')
2023-12-31 13:13:14,001 - Command repositories: ODP-<IP_ADDRESS>-21
2023-12-31 13:13:14,001 - Applicable repositories: ODP-<IP_ADDRESS>-21
2023-12-31 13:13:14,002 - Looking for matching packages in the following repositories: ODP-<IP_ADDRESS>-21
Command aborted. Reason: 'Server considered task failed and automatically aborted it'
Command failed after 1 tries

stderr:
2023-12-31 13:22:58,881 - The 'zookeeper-server' component did not advertise a version. This may indicate a problem with the component packaging.
Traceback (most recent call last):
File "/var/lib/ambari-agent/cache/stacks/ODP/1.0/services/ZOOKEEPER/package/scripts/zookeeper_server.py", line 138, in
ZookeeperServer().execute()
File "/usr/lib/ambari-agent/lib/resource_management/libraries/script/script.py", line 352, in execute
method(env)
File "/var/lib/ambari-agent/cache/stacks/ODP/1.0/services/ZOOKEEPER/package/scripts/zookeeper_server.py", line 67, in install
self.install_packages(env)
File "/usr/lib/ambari-agent/lib/resource_management/libraries/script/script.py", line 843, in install_packages
name = self.format_package_name(package['name'])
File "/usr/lib/ambari-agent/lib/resource_management/libraries/script/script.py", line 566, in format_package_name
return self.get_package_from_available(name)
File "/usr/lib/ambari-agent/lib/resource_management/libraries/script/script.py", line 533, in get_package_from_available
raise Fail("No package found for {0}(expected name: {1})".format(name, name_with_version))
resource_management.core.exceptions.Fail: No package found for zookeeper_${stack_version}(expected name: zookeeper_1_2)
stdout:
2023-12-31 13:22:42,376 - Stack Feature Version Info: Cluster Stack=1.2, Command Stack=None, Command Version=None -> 1.2
2023-12-31 13:22:42,413 - Group['hadoop'] {}
2023-12-31 13:22:42,419 - User['zookeeper'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': ['hadoop'], 'uid': None}
2023-12-31 13:22:42,468 - User['ambari-qa'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': ['hadoop'], 'uid': None}
2023-12-31 13:22:42,496 - File['/var/lib/ambari-agent/tmp/changeUid.sh'] {'content': StaticFile('changeToSecureUid.sh'), 'mode': 0555}
2023-12-31 13:22:42,499 - Execute['/var/lib/ambari-agent/tmp/changeUid.sh ambari-qa /tmp/hadoop-ambari-qa,/tmp/hsperfdata_ambari-qa,/home/ambari-qa,/tmp/ambari-qa,/tmp/sqoop-ambari-qa 0'] {'not_if': '(test $(id -u ambari-qa) -gt 1000) || (false)'}
2023-12-31 13:22:42,610 - Skipping Execute['/var/lib/ambari-agent/tmp/changeUid.sh ambari-qa /tmp/hadoop-ambari-qa,/tmp/hsperfdata_ambari-qa,/home/ambari-qa,/tmp/ambari-qa,/tmp/sqoop-ambari-qa 0'] due to not_if
2023-12-31 13:22:42,740 - Repository for ODP/1.2/ODP-<IP_ADDRESS>-21 is not managed by Ambari
2023-12-31 13:22:42,740 - Repository[None] {'action': ['create']}
2023-12-31 13:22:42,759 - Package['unzip'] {'retry_on_repo_unavailability': False, 'retry_count': 5}
2023-12-31 13:22:47,875 - Skipping installation of existing package unzip
2023-12-31 13:22:47,876 - Package['curl'] {'retry_on_repo_unavailability': False, 'retry_count': 5}
2023-12-31 13:22:51,579 - Skipping installation of existing package curl
2023-12-31 13:22:51,773 - call[('ambari-python-wrap', u'/usr/bin/odp-select', 'versions')] {}
2023-12-31 13:22:51,903 - call returned (1, 'Traceback (most recent call last):\n  File "/usr/bin/odp-select", line 499, in \n    printVersions()\n  File "/usr/bin/odp-select", line 338, in printVersions\n    for f in os.listdir(root):\nOSError: [Errno 2] No such file or directory: '/usr/odp'')
2023-12-31 13:22:52,841 - Command repositories: ODP-<IP_ADDRESS>-21
2023-12-31 13:22:52,841 - Applicable repositories: ODP-<IP_ADDRESS>-21
2023-12-31 13:22:52,842 - Looking for matching packages in the following repositories: ODP-<IP_ADDRESS>-21
2023-12-31 13:22:58,804 - call[('ambari-python-wrap', u'/usr/bin/odp-select', 'versions')] {}
2023-12-31 13:22:58,880 - call returned (1, 'Traceback (most recent call last):\n  File "/usr/bin/odp-select", line 499, in \n    printVersions()\n  File "/usr/bin/odp-select", line 338, in printVersions\n    for f in os.listdir(root):\nOSError: [Errno 2] No such file or directory: '/usr/odp'')
2023-12-31 13:22:58,881 - The 'zookeeper-server' component did not advertise a version. This may indicate a problem with the component packaging.
Command failed after 1 tries

maybe you can try to make dir from this message
No such file or directory: '/usr/odp'

Hi @aghazeh ,
The ODP Version is not the good one, you should use <IP_ADDRESS>-134 as per the documentation.
<IP_ADDRESS>-21 was released during testing of ODP 1.2.1 builds
Try with the proposed version and let us know if it does work
Best regards

Hi @lucasbak
By ODP version, if you meant the rpms of components, it is <IP_ADDRESS>-134.
But the stack number for odp stack is 1.2.10-21 included in Ambari server which i downloaded from:

Seems like that Ambari's rpms not updated, cause in source, the version is 134:
https://github.com/clemlabprojects/ambari/blob/<IP_ADDRESS>/ambari-server/src/main/resources/stacks/ODP/1.2/repos/repoinfo.xml

Hi,
Indeed Ambari contains an example for the VDF file. <IP_ADDRESS>-21, here is a screenshot to show you how to specify  a different one when installing your cluster.

For using <IP_ADDRESS>-134 you can use this link https://clemlabs.s3.eu-west-3.amazonaws.com/centos8/odp-release/<IP_ADDRESS>-134/ODP-VDF.xml
Best regards

@lucasbak Thanks alot, that fixed the problem! Although I had to change two minor changes to VDF file:
ODP-1.0 to ODP-1.2
ODP-1.0 to       ODP-1.2

Hi @farshad-allahdadi
Glad to see it fixed your problem :)
Indeed the change you made is also required for changing major Version.
@aghazeh did you try the fix ?
Best regards


Use P4 syntax for bitvector literals

https://p4.org/p4-spec/docs/P4-16-v1.0.0-spec.html#sec-literals

If you want to do this we should to it as soon as possible, before we have too many people writing programs.

Actually, I am not sure. Both syntaxes are similarly quirky. I don't see how the P4 one is significantly better.

The single quote trips up many tools. For example, if you want to use the C preprocessor it will be very upset.

We have to revisit this: we need a syntax for signed literals. P4 has one, and I don't see how to tweak the ddlog syntax in a nice way.


Errors in launching fargate task

What would you like to be added:
After I register task definition as described in firelens/README.md, launching the task failed with the following error.
CannotStartContainerError: ResourceInitializationError: failed to initialize logging driver: failed to get fluentd log driver arguments: logging driver specified of container xxxxxxxx, but no log configuration specified

I launched the service with Fargate 1.4.0 to enable EFS volume mount for fluent.conf. It requires options in log driver settings in each container.
For workaround, the following task definition and fluent.conf work for Fargate. (I use concat for multiline logs).
task definition
  logConfiguration:
    logDriver: awsfirelens
    options:
      '@label': '@CONCAT'
      '@type': relabel

@label: @SPLUNK should also work in this case.
fluent.conf
<system>
  log_level info
</system>

<label @CONCAT>
  <filter **xxxxxxxx**>
    @type concat
    key log
    stream_identity_key stream
    multiline_start_regexp /^[0-9]{4}/\d{2}/\d{2}\s+\d{2}:\d{2}:\d{2}\.\d{6}/
    flush_interval 5s
    timeout_label @SPLUNK
    use_first_timestamp true
  </filter>

  <match **>
    @type relabel
    @label @SPLUNK
  </match>
</label>

<label @SPLUNK>
  <match **>
    @type splunk_hec
    protocol http
    hec_host <SPLUNK_HEC_HOST>
    hec_port 8088
    hec_token xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
    index ecs
    host_key ec2_instance_id
    source_key ecs_cluster
    sourcetype_key ecs_task_definition
    #source_key ecs_task_arn
    #sourcetype_key container_name
    insecure_ssl true
    <fields>
      container_id
      container_name
      ecs_task_arn
      source
    </fields>
    <format>
      @type single_value
      message_key log
      add_newline false
    </format>
  </match>
</label>

Why is this needed:

For the record, '@type': '' also didn't work. fluentd-hec container stopped with the following error logs soon after it started.
2020-07-10 05:38:36 +0000 [info]: parsing config file is succeeded path="/fluentd/etc/fluent.conf"
2020-07-10 05:38:36 +0000 [error]: config error file="/fluentd/etc/fluent.conf" error_class=Fluent::ConfigError error="Unknown output plugin ''. Run 'gem search -rd fluent-plugin' to find plugins"

This is because @type in the task definition was blank and fluentd didn't recognize the blank plugin.

I request firelens/README.md document update that refers to fargate task definition and fluent.conf.

Hello, we will review and update doc accordingly.


[Edit docs] Change references to Hiro Wallet to Leather Wallet

URL of the page to change: https://docs.stacks.co/docs/tutorials/hello-stacks

This page references Hiro Wallet but the wallet has been rebranded to Leather Wallet.  This is the only page I've read so I bet there are other occurrences as well.
IMO it's probably sufficient to find and replace instances of Hiro wallet with Leather wallet in the docs and update the first instance of Hiro wallet in each page with Leather wallet (formerly Hiro wallet) to avoid confusion.

Also I suppose this bit under Wallet Setup is technically wrong because the wallet app is owned by Trust Machines:

... visit Hiro's wallet page and install it. ...

Going through and catching up on old docs issues. Sorry for the delay on this, got this fixed.


Various RTL fixes

This PR fixes a handful of components that have issues with RTL languages:

Switch component toggles to the correct direction
Sliders don't change their layout
ListSection label aligns itself correctly
TextFieldLabel fits within the textfield now

@ds8k Looks good!


Try to run multiple mongo scrap book commands before extension activates

Repro steps:

) Have a scrapbook opened
) Run a command multiple times before the extension finishes activating
3.) Works, but this error comes up

Action: cosmosDB.executeMongoCommand
Error type: Error
Error Message: TextEditor#edit not possible on closed editors
Version: 0.6.0
OS: win32

Is this similar to a vscode issue?


src/structure: format and minimize trait bounds

There are two related changes here. Neither one involves a change to the function of the code. Both are localized to the src/structure directory to reduce the number of changes to review.
The first change is to run rustfmt over all of the source files in the directory. This is mostly a whitespace change.
The second is reduce the usage of trait bounds to only where they are needed. The main changes were:

In general, the structs did not need trait bounds. I removed all except one, which was necessary.
There were a large number of Clone bounds that were not needed. I removed all except the necessary ones, which I attached to functions instead of the implementation.
I reduced the number of AsRef<[u8]> bounds to make it clear which functions used it and which did not.

Codecov Report

:exclamation: No coverage uploaded for pull request base (master@92009c5). Click here to learn what that means.
The diff coverage is 91.66%.

@@            Coverage Diff            @@
##             master      #31   +/-   ##
=========================================
  Coverage          ?   74.58%
=========================================
  Files             ?       21
  Lines             ?     6835
  Branches          ?      983
=========================================
  Hits              ?     5098
  Misses            ?      785
  Partials          ?      952

Impacted Files
Coverage Δ

src/structure/vbyte.rs
79.12% <100%> (ø)

src/structure/util.rs
87.5% <100%> (ø)

src/structure/logarray.rs
75.28% <87.5%> (ø)

src/structure/bitarray.rs
78.08% <90.19%> (ø)

src/structure/wavelettree.rs
81.59% <90.38%> (ø)

src/structure/bitindex.rs
78.37% <90.55%> (ø)

src/structure/adjacencylist.rs
84.02% <93.46%> (ø)

src/structure/pfc.rs
78.1% <93.75%> (ø)

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 92009c5...a521112. Read the comment docs.

BTW, my motivation for submitting this is that I want to work on files in src/structure, and I think that will be easier if (a) the formatting is standardized (with rustfmt) and (b) the code is easier to work with (i.e. the reason for minimizing trait bounds). Of course, people can disagree (politely! 😉) on aspects of style, and I'm happy to discuss it.

Why do you consider trait bounds on functions better than having those bounds on the structures?

Why do you consider trait bounds on functions better than having those bounds on the structures?

There are a couple of things here:

Consider the LogArray struct defined as:
#[derive(Clone)]
pub struct LogArray<M: AsRef<[u8]> + Clone> {
    len: u32,
    width: u8,
    len_bytes: usize,
    data: M
}

I can remove the trait bound on M (AsRef<[u8]> + Clone), and it has no affect the rest of the library. Given that fact, I see the trait bound as superfluous and contributing more to clutter than to clarity.
The one exception to this in this PR is AdjacencyListBuilder, in which an associated type is used in the struct definition:
pub struct AdjacencyListBuilder<F,W1,W2,W3>
where F: 'static+FileLoad+FileStore,
      W1: 'static+AsyncWrite+Send,
      W2: 'static+AsyncWrite+Send,
      W3: 'static+AsyncWrite+Send {
    bitfile: F,
    bitarray: BitArrayFileBuilder<F::Write>,
    bitindex_blocks: W1,
    bitindex_sblocks: W2,
    nums: LogArrayFileBuilder<W3>,
    last_left: u64,
    last_right: u64
}

In this case, F: FileStore is needed to get F::Write in type of bitarray.

Most of the struct implementation blocks have trait bounds in the impl declaration. I've removed the ones in which the trait bounds do not apply to all functions in the impl block, pushing those trait bounds onto the inherent methods in which they are required.
This is partially a matter of taste, but I think it can have a meaningful impact on the usability of the code. By having unrequired trait bounds on a function, the type of the function becomes misleading. And other functions that use that function may also then require possibly unnecessary trait bounds.
In some cases, a struct may be constructed or used with different sets of trait bounds. So forcing unrequired trait bounds limits the use of the struct. I don't think this is the case for any structs that I changed: for example, many structs are not useful without M: AsRef<[u8]>; however, I think it's good practice to use minimal types and, therefore, only the required trait bounds.
In my second commit, I added, for example, where M: AsRef<[u8]> to a number of functions. An alternative approach would be to have a second implementation section with those functions: impl<M: AsRef<[u8]> Struct<M> { ... }. I would be fine with this option.

While you're right that pushing the trait bounds down to a subset of the function allows more flexibility in using this library, I do have my doubts that this is more clear or better.
In my opinion, AsRef<[u8]> is not an incidental implementation detail of just some functions, but part of the identity of these structs. Their whole point is that they are some kind of interpretation of an underlying byte array. The trait bound documents this. There is no intended use case of these structs where you would not have some underlying byte storage.
If you have an intended use case for instantiating these structs without an underlying byte array, please let me know, but I don't want to apply this change just cause it is better in an abstract programming theory kind of way. Sorry.
Regarding rustfmt, I feel bad about not using it yet. I'll reformat all library code soon and intend to start enforcing proper formatting through a build check.

While you're right that pushing the trait bounds down to a subset of the function allows more flexibility in using this library, I do have my doubts that this is more clear or better.

Indeed, that is one consequence of what I am suggesting in general. However, that is not my motivation here, because I see that it doesn't apply.

In my opinion, AsRef<[u8]> is not an incidental implementation detail of just some functions, but part of the identity of these structs. Their whole point is that they are some kind of interpretation of an underlying byte array. The trait bound documents this. There is no intended use case of these structs where you would not have some underlying byte storage.

Fair enough.

If you have an intended use case for instantiating these structs without an underlying byte array, please let me know, but I don't want to apply this change just cause it is better in an abstract programming theory kind of way. Sorry.

While I think my change is not better in an abstract way but in a very practical way (since it documents the minimal type of each function), I grant you that, as a collection of functions for a given struct, they are not useful without the implementation-level AsRef<[u8]>. I don't have any other use cases.

Regarding rustfmt, I feel bad about not using it yet. I'll reformat all library code soon and intend to start enforcing proper formatting through a build check.

Thank you! I look forward to that. Should I wait for that before submitting any more PRs?

In the meantime, I'll close this, since you have no intention of merging it.

I pushed a full reformatting just now, so feel free to submit more PRs.


get_news() search returning 'NoneType' error

I am getting an error while attempting to use the get_news() function. I have checked the version using gNews.getVersion() and it shows 1.6.11. Half of the time i use the get_news() function it works, half the time it returns a blank list, but every time i get the same 2 errors logged repeatedly.
my code:
gNews = GoogleNews(period='20d')
gNews.get_news(topic)

The error:
 'NoneType' object has no attribute 'parent'
'NoneType' object has no attribute 'startswith'

I'm seeing the same issue

Issue solved with latest version 1.6.12

Thank you very much for your timely feedback and action~ saved my little project~


ValueError: 'SUSPENDED' is not a valid GroupMemberStatus

Describe the bug
When I've tried to run IAMbic with Google I receive this error
To Reproduce
Run iambic setup against your google workspace

Follow the documentation of IAMbic to setup Google: https://docs.iambic.org/getting_started/google
Run iambic setup and put the information needed
See error

Expected behavior
Setup the Google with IAMbic and you can import the informations about the groups.
Screenshots
    status=GroupMemberStatus(member.get("status", GroupMemberStatus.UNDEFINED)),   File "/usr/lib64/python3.9/enum.py", line 384, in __call__     return cls.__new__(cls, value)   File "/usr/lib64/python3.9/enum.py", line 702, in __new__     raise ve_exc ValueError: 'SUSPENDED' is not a valid GroupMemberStatus
Desktop (please complete the following information):

OS: Amazon-Linux
Version 2

What I did to resolve?
I had to add the SUSPENDED in models.py on iambic-templates/venv/lib/python3.9/site-packages/iambic/plugins/v0_1_0/google_workspace/models.py.
After I did this, I can run the setup and import smoothly! =)

Nice report @victorSouza-DevOPS , thank you! Would you mind submitting a PR to resolve the issue? If you'd like us to, just say the word and we'd be happy to.

Hi @castrapel ! Ok, I've already send the PR to main branch! https://github.com/noqdev/iambic/pull/483

Awesome thanks @victorSouza-DevOPS ! There is a CLA it will ask you to sign, but after that it should be good to go and we can merge.

Ok, already signed in on CLA.

this is released in 0.10.3 (sorry somewhat behind on backfilling the Changelog)


Flux related packages

Hey guys, great job w/ this. I can't wait to test-drive it when its incorporated into MLJ.jl.
There are some nice packages related to Flux:
FluxOptTools: helps achieve an optimal solution (see discussion)
NaiveGAFlux: helps automate Flux tuning (like Auto Keras, Auto Pytorch)
It may be awesome to incorporate these things at some point. Or at least keeping on your radar...

Great, thanks! I expect we will be incorporating elements of the two packages in https://github.com/alan-turing-institute/MLJ.jl/issues/139

I'd be happy to contribute if you'd like to make use of NaiveGAflux (or one of it's more barebones dependencies).


Switched multi-output prediction arrays

Hello @kpe,
first of all, thank you for sharing your very useful repos.
Using bert-for-tf2 for a QA task I created a model with 4 outputs.
For the model creation I specify the outputs as a dictionary with keys in this order:
"id", "start", "end", "type".
When predicting I would expect the predictions output as a list of arrays in the same order:
[id, start, end, type]
but I receive instead a list in the following order:
[type, end, start, id]
(actually, "end" and "start" have the same shape so I am not sure about their relative positions).
Is this "position-switching" of the output arrays a normal behavior or could it be an issue with bert-for-tf2?
Thank you

@roebius - this is most likely an issue with keras and dict outputs - internally in tf.keras the dict is flattened to a list, and the order might get changed. I thought until now that the order in this case is alphabetical (and would be interested to understand why that's not the case - I believe it is different between TF versions; I also have issued a different but related bug to the TF team - https://github.com/tensorflow/tensorflow/issues/34199).
I don't think it is an issue with bert-for-tf2. I guess you are using BertModelLayer which is just a layer (not aware of the "outer" keras model populating the outputs). You could easily replace it with an EmbeddingLayer and see, if the keras behavior will  change.

@roebius - I believe it is name of the output tensor that counts not the dictionary entry :-)
I'm using a:
ident = lambda n: tf.keras.layers.Lambda(lambda a: a, name=n)
outputs = [ident("output-a")(out_a), ident("output-b")(out_b)]

to force the names on the output tensors.

Thank you for your reply and suggestions.
I confirm I am using BertModelLayer. I also believe it is a Keras issue, but it is a bit complicated for me to change the output layer names: some TF ops I am using force name prefixes for the output layers, so I have to use the actual layer names for my losses but I have to use different names for the TFRecords I am feeding.

@roebius - changing the output names can be done with the ident function/layer above. But if I remember correctly it is relevant for the model losses only.

I was eventually able to solve the issue.
For the model creation, I am passing the outputs as a list instead of a dictionary: this way the prediction outputs are not switched anymore.
Thanks to your ident suggestion I was able to refactor my code in order to use the output layer names consistently between model output, model losses and TFRecord feature mapping when feeding the model for fit/predict.
Many thanks again.


Feature request: timezone support to specify cron

Saw this in another terraform module:
https://github.com/neillturner/terraform-aws-lambda-scheduler
  time = "Europe/London"

would be helpful

Hello
Right now I wouldn't integrate this feature in the python code part. I would prefer to integrate it in Cloudwatch event but the cron support in AWS Cloudwatch is really limited and its doesn't support timezone.


update the game over message

Update the game over message so people know how to play again

pay attention to the confidence intervals as you review this paper

Attention to detail


Bug Report: Game pauses itself making it unplayable

Please check for duplicates, similar issues or closed issues with the same problem, as well performing simple troubleshooting steps (such as deleting the export folder if it's an issue with compiling, reinstalling Kade Engine) before submitting an issue.
If you are playing a downloaded version of the game, what operating system are you using?
Windows (x86), Windows (x86_64), Linux, or macOS? Specify below.
Windows x86_64
What version of the game are you using? Look in the bottom left corner of the main menu.
KE 1.8 (Latest Stable)
Have you identified any steps to reproduce the bug? If so, please describe them below. Use images if possible.
There's not really much needed to re-create it. I just need to open up Kade, play a song, and then boom. It happens. It pauses itself.
Please describe your issue. Provide extensive detail and images if possible.
For some reason the game just pauses itself upon playing any song. Everything else works properly. The menus, the options, everything. It's just for some reason it keeps pausing itself when I get into the actual game, and when I unpause it, it pauses itself back, making it unplayable. I have no idea why this happens.
https://user-images.githubusercontent.com/85147071/138976259-243edf64-10f9-4fe2-a550-4eed5944fcb4.mp4

i tried resetting my keybind settings and it got even worse, and not to mention this was also happening to me before i even set any keybinds. what is going on??

i did something i found, but it only changed it back to the original state. Why is it acting like this? yesterday it was just fine.


Samples quality generated from Pretrained model support

Hi,
I try to generate samples from your pretrained model, but the quality is not good. More specifically, the pitch is much higher than original sample, and many noise in the sample, like below

Here is what I did:

clone repo
change hparam sample rate from 22050 to 24000
download reference audio you provided: https://lmnt.com/assets/wavegrad/24kHz
preprocess wav to extract mel with preprocess.py
inference from extracted mel and generate audio with inference.py
I didn't modify any code during this.
Could you please help have a look. Am I missing anything here?

Thanks

I think the issue is the same as https://github.com/lmnt-com/wavegrad/issues/7#issuecomment-763200927. Can you try that and let me know if that works better for you?

I think the issue is the same as #7 (comment). Can you try that and let me know if that works better for you?

It works.
Thank you!

I think the issue is the same as #7 (comment). Can you try that and let me know if that works better for you?

It works. Thank you!

@softrimewu @sharvil Hi, I met the same problem as you, can you explain the solution in detail? Thank you so much.
I did the same steps as you and replaced the new preprocess.py in the fourth step, but the result was still noisy.
Are there any other parameters to be modified besides the sampling rate？


Importing python library on M1 chip MacOS

Hi @andrewssobral,
I am having issues importing the python library with M1 chip MacOS. It seems to be related to the architecture of my machine. I describe my environment and how to reproduce the bug does below:
I have compiled bgslibrary with support for Python on MacOS as stated in https://github.com/andrewssobral/bgslibrary/wiki/Wrapper:-Python. The code compiled well using a Conda environment with the following installations:
-OpenCV 3.4.7
-Python 3.8.6 (Anaconda)
Compilation was done with:
cmake -D BGS_PYTHON_SUPPORT=ON ..
Then, I added the generated lib (pybgs.cpython-39-darwin.so) to my Python path:
export PYTHONPATH="${PYTHONPATH}:/Users/xavibou/Documents/repos/change_detection/methods/bgslibrary/build"
When  try to run the demo with the command python demo.py, I get the following error:
Traceback (most recent call last):
File "/Users/xavibou/Documents/repos/change_detection/methods/bgslibrary/demo.py", line 3, in
import pybgs as bgs
ImportError: dlopen(/Users/xavibou/Documents/repos/change_detection/methods/bgslibrary/build/pybgs.cpython-39-darwin.so, 0x0002): tried: '/Users/xavibou/Documents/repos/change_detection/methods/bgslibrary/build/pybgs.cpython-39-darwin.so' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/usr/local/lib/pybgs.cpython-39-darwin.so' (no such file), '/usr/lib/pybgs.cpython-39-darwin.so' (no such file)
Thank you,
Xavi

Hello @xavibou
Thanks for opening this issue.
Yes it's related to the architecture.
However, I need to investigate it more deeply, it's not clear to me how to fix it.


NAV does not scroll when its extends beyond screen

When left nav is visible, if it's longer than the screen length, it doesn't scroll
@gauntface - may have broken this one too with the change to the mdl library in the template.

I see scrollbars (after fixing issue with js).


[bug] naming an argument cmd causes unexpected and undocumented error

Describe the bug
I named an argument for a custom command cmd, which used to work previously but now it seems to be a special name that gets treated differently by tauri. In fact it seems to override the command specified as the first parameter to invoke().
#[tauri::command]
pub fn my_command(
  cmd: String
) -> Result<String, String> {
    info!("This never gets logged");
    Ok(String::new())
}

I invoked it from JS like this:
window.__TAURI__.invoke("my_command", {cmd: "test"})

and instead of calling my_command and passing that argument, it returns the error message command "test" not found in the frontend and the backend command was never executed.
This seems really strange to me. Why would certain argument names be considered special?
Is this documented anywhere?
Given that there are such special argument names, could these please be documented here? or at least somewhere prominent?
https://tauri.app/v1/guides/features/command
Even better, I'd argue that any "special" args internal to tauri should be an optional 3rd parameter to invoke() rather than overloading the user-supplied args list.
Reproduction
#[tauri::command]
pub fn my_command(
  cmd: String
) -> Result<String, String> {
    info!("This never gets logged");
    Ok(String::new())
}

Now try to invoke the above command. This doesn't work:
window.__TAURI__.invoke("my_command", {cmd: "test"})

Instead it gives the error Uncaught command test not found
Expected behavior
I'd expect all of the arguments given in the 2nd parameter to invoke() to be delivered to my function regardless, and not to have any "magic" args that are treated differently. Any such special internal args should be in a separate parameter given to invoke()
Platform and versions
Environment
› OS: Windows 10.0.22000 X64
› Webview2: 103.0.1264.77
› MSVC:
› Node.js: 16.13.0
› npm: 8.1.0
› pnpm: Not installed!
› yarn: Not installed!
› rustup: 1.25.1
› rustc: 1.62.0
› cargo: 1.62.0
› Rust toolchain: stable-x86_64-pc-windows-msvc
Stack trace
No response
Additional context
No response

Is it not fix in version    "@tauri-apps/api": "^1.1.0" ? I encountered this bug when call a functhion like this:

#[tauri::command]
fn mycmd(cmd: &str) -> String{
    format!("Hello, {}! You've been greeted from Rust!", cmd)
}


¿How I could fix the error Models must be owned by only a single documen....

In the script to pratics that You can still specify a column of the DataFrame as the bar category via the x argument if you do not wish to use the index, I get the error
RuntimeError: Models must be owned by only a single document, HelpTool(id='6110', ...) is already in a doc
¿How I could fix this error?. I will appreciate your help.

Hi @akitxu ,
could you please provide a minimal example to reproduce the error?
Best Patrik

Duplicate of #90

Dear
Given the difficulties in understanding how to customize graphics with bokeh (legends, scales, etc.), and some error like the one that caused this query, I left bokeh aside a bit and focused on knowing other graphic possibilities, without ruling out returning to this in the future (especially if I find a tutorial on the internet). For these reasons, I forgot this query and did not answer it, since I lost the reference script. I apologize. I beg you to remove it from the issues. Kind regards


P2P governor might demote local peers

It could happen that the p2p-governor will demote local peers. p2p-governor should  guarantee that it keeps local peers in hot state, and when they disappear (due to reconfiguration etc), it retries to connect to them as soon as they are back online.

What is the state of this issue? I believe that the second part is what happens

Duncan has fixed this issue.


incorrect variable use in pwn_read

pwn_read() returns 'len' which causes a compiler error as it is not defined. I think what was meant here was to return 'count' instead.
Signed-off-by: marky<EMAIL_ADDRESS>

Yes, you're right. len used to be a variable in pwn_read and wasn't cleaned up properly when I was touching up the source.


[Bug]: makeTestResults fails with Maximum call stack size exceeded exception

Version
27.5.1
Steps to reproduce
Create a test file file.sppec.js with the following content and run yarn jest file.spec.js
describe('first level', () => {
  for (let j = 0; j < 200_000; j++) {
    it(`#${j}`, () => {
      expect(1).toBeTruthy();
    });
  }
});

Expected behavior
Jest execute the tests and print details
Actual behavior
Jest fails on results printing with the following error:
    RangeError: Maximum call stack size exceeded

      at makeTestResults (node_modules/jest-circus/build/utils.js:527:21)
      at TestScheduler.scheduleTests (node_modules/@jest/core/build/TestScheduler.js:333:13)
      at runJest (node_modules/@jest/core/build/runJest.js:404:19)
      at _run10000 (node_modules/@jest/core/build/cli/index.js:320:7)
      at runCLI (node_modules/@jest/core/build/cli/index.js:173:3)

Additional context
No response
Environment
System:
    OS: macOS 14.1.2
    CPU: (8) arm64 Apple M2
  Binaries:
    Node: 20.4.0 - ~/Library/Caches/fnm_multishells/15759_1702555821872/bin/node
    Yarn: 3.1.0 - ~/Library/Caches/fnm_multishells/15759_1702555821872/bin/yarn
    npm: 9.8.1 - ~/xxx/zzz/node_modules/.bin/npm
    pnpm: 8.12.1 - ~/Library/Caches/fnm_multishells/15759_1702555821872/bin/pnpm
  npmPackages:
    jest: 27.4.7 => 27.4.7

https://github.com/jestjs/jest/releases/tag/v30.0.0-alpha.3


Wave streaming

This PR adds streaming to the wave chat window. Thanks a lot to @mturoci who helped with the implementation!

@psinger After some back and forth, I managed to suppress the log info. Now, it doesn't show up throughout the app which should be fine IMO.


RANGER-3310 build_ranger_using_docker.sh does not reuse maven local c…

issue: https://issues.apache.org/jira/browse/RANGER-3310
Description
The command 'stat -c "%u" pom.xml' is used to get the UID from host. However, the command is not supported by macOS. Hence, macOS users can't pass 'mvn xxxx' to call build_ranger_using_docker.sh since it causes error like "stat: illegal option -- c". The maven cache of host is mounted to correct path when the command line starts with "mvn". In other words, macOS users can't reuse maven cache and all dependencies have to be download again...
This patch aims to add following changes.

instead of using gosu, we directly align UDI inside/outside containers (the container can modify the .m2 folder of host)
mount the m2 folder to correct path when running container.

Test Result (macOS M1)
./build_ranger_using_docker.sh 2>&1 > ~/log
RANGER-3310.log
Test Result (ubuntu 21.04 amd64)
./build_ranger_using_docker.sh 2>&1 > ~/log
RANGER-3310.log
Test Result (macOS amd64)
./build_ranger_using_docker.sh 2>&1 > ~/log
RANGER-3310.log

the CI fix is related to #105

Run this patch on three platform (macOS m1, macOS amd64 and ubuntu amd64). all works well.

@mneethiraj Could you please take a look? this PR fixes the tool of building code by docker. Furthermore, it fixes the broker maven url.

@chia7712 - dev-support/ranger-docker directory has updated setup to build and run Ranger in docker container. I suggest to use this instead of build_ranger_using_docker.sh.

dev-support/ranger-docker directory has updated setup to build and run Ranger in docker container. I suggest to use this instead of build_ranger_using_docker.sh.

Thanks for the suggestion! Should we remove this file if there is already replacement?


Added support for texture paths with spaces

First congratulation on the great plugin, it works really well!
While testing a few maps I noticed that TrenchBroom exports texture paths with spaces in quotes. Unfortunately the current tokenizer for the map format ignored the quotes and cut the paths at the first space.
I tried to fix this by allowing the tokenizer to skip spaces while parsing the texture scope. It is not the most elegant solution due to introducing scope dependence in the tokenizer but else the entity parsing code was impacted, but it allows usage of spaces in texture filenames now.

It seems like I forgot to review this PR, my apologies! 🙈 Thank you! 🎉


Introduction of the ImmutableAttribute to decorate properties that should not be changed after initialization

It is a prerequisite for #28, where an ID should be decorated as such, but it deserves a change set on its own.

After some consideration, I think will not work.


docs(readme): Modify video permission key name

Motivation (required)
Corrected iOS video permission key names in the README.
Issue: 'NSCameraUsageDescription' is a duplicate.
Before: NSCameraUsageDescription & NSCameraUsageDescription
After : NSCameraUsageDescription & NSMicrophoneUsageDescription
Test Plan
Since this is a modification to the README documentation, there are no tests.
Link to 'NSMicrophoneUsageDescription'

I was working on the main branch, so I closed the PR, I created a new branch, reworked it and created a PR.


sw-Toolbox reports an empty precache when used with sw-precache

Since we advertise them as working together, this looks like a bug.

Can you provide some additional information? What methods are you calling and what are they returning?
In general, the two libraries compliment each other, and the caches they maintain are independent.

I assume this about this debug line.
It's correct that Toolbox reports that it isn't precaching anything, because Precache is handling it.


Encode a transaction to binary/string

Not sure if there is an available method to serialize it to a string. But we already implemented in #31 a to_bytes() method, which corresponds to write() in librustzcash. Probably we could close this, but lets wait for other inputs.

Not sure if there is an available method to serialize it to a string. But we already implemented in #31 a to_bytes() method, which corresponds to write() in librustzcash. Probably we could close this, but lets wait for other inputs.

Like mentioned in other issue if struct has read and/or write methods - use them to implement from_bytes and to_bytes - we can't really make read and write cross the ffi barrier, but at least we can provide from_bytes, to_bytes methods as a (slightly less performant) alternative.

Closing this, as we already have an implementation of to_bytes() , forged at #31 .


Inconsistent behaviour when saving

I've been using webpack-dev-server (gulp) with HMR for a long time now, and the larger the project gets (around 1000 files in 100 directories, 8 entry points), the more often I notice saving files doesn't trigger any reaction.
I mean, gulp console doesn't say "bundle is now INVALID", browser console doesn't say "App updated. Recompiling". Bundle doesn't get built, browser doesn't get refreshed. This happens every ~5th save or so.
I've tried to somehow understand the problem better, maybe some specific library/file/folder is the culprit, but to no avail.
I am using Windows.
Is this a known problem? Do you have any ideas how I can solve this? Or how I can somehow debug this better.

Can you provide a test case?


Integrate S3 Compatible API's for Etcd Snapshot Targets

Thanks for helping us to improve k3s! We welcome all feature requests. Please fill out each area of the template so we can better understand the request. You can delete this message portion of the bug report.
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Describe the solution you'd like
A user should be able to store Etcd snapshots to an S3 compatible API.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.

Validated all verification instructions provided using commit id.
k3s version v1.20.5+k3s-a3ec5904

Validated using v1.20.5-alpha1+k3s2 on a single node and multi-node setup

On-demand snapshots stored locally and to s3
Automated snapshots stored locally as well as to s3
Restoration from snapshots stored locally and from s3
Validated quorum loss scenario on a multi-node setup with nodes powered down
Validated snapshot retention to s3

Related minor issue with snapshot retention https://github.com/k3s-io/k3s/issues/3178
Unrelated to snapshot but impacted due to parsing of '*' in scheduled snapshot creation using install script https://github.com/k3s-io/k3s/issues/3179
Scheduling automated snapshots can be done using config.yaml


Removing analysis block and analysisJobCount

Now that #310 has merged, we can cleanup these unnecessary fields.

/hold
Waiting for https://github.com/openshift/release/pull/21686 to merge

/unhold

glad to see this cleaned up
/lgtm

/unhold


Array type - Add / Reorder / Delete buttons not rendering well on mobile

Prerequisites

[x] I have read the documentation.

Description
When I try to use an array type with multiple fields on mobile, it seems that the buttons are not rendering well as you can see in the picture below (mainly, the + icon is not well centered inside the button and most importantly there is a horizontal scroll appearing, which is not something very nice).

Steps to Reproduce

Go in the "array" playground section
Use Chrome DevTools to mimick a mobile size (for instance iPhone 6 Plus)
See the results

Version
0.40.0

We've updated the styling of these buttons lately, could you please test against latest v0.41.0 to see if it's better for you?

It seems okay on my side with this new version 😄 Great job by the way 👍


Set cookie domain for .AspNet.StuntmanAuthentication

Hi,
I have two mvc projects side by side and would like to use stuntman across both.
.AspNet.StuntmanAuthentication now has demo1.xyz.com as the domain on one site and demo2.xyz.com on the other site.
With app.UseCookieAuthentication(new CookieAuthenticationOptions {  CookieDomain = ".xyz.com" } ) i can share the cookie for owin but is something similar possible with Stuntman?
Thanks.

Specifying the CookieDomain on CookieAuthenticationOptions does not appear to be currently supported. Interested in submitting a pull request to add it?

At a glance it looks like here https://github.com/ritterim/stuntman/blob/fa0f2899900fa45d3caa7c4c9cf61c5c10e78c68/src/Core/IAppBuilderExtensions.cs#L36-L42 and https://github.com/ritterim/stuntman/blob/fa0f2899900fa45d3caa7c4c9cf61c5c10e78c68/src/Core/IServiceCollectionExtensions.cs#L39-L46 with an additional optional setting added to StuntmanOptions.

I'll have a go but in the middle of a release so may take a while :)


Make node server and client on Alinous Server

Make node server and the client. Check the launching & shut down process.

test


How we can access a particular slide of  a presentation?

My use case is that I want to add slide not at end but in between some slides.

There's no access to internal slides. You need to have your data set in order before you generate a PPT.


Mail receive works, but list of mail is empty

A user tried to send another user a mail. It reported a success and the recipient received a message, but could find no message in the list. I don't see any console errors.

You need to update

This is still occurring with 6.9c.

Could not reproduce this


Upd: Normalize behaviour of getVersionNumber on windows.

The windows version returns <IP_ADDRESS>, whereas the iOS and android version limit it to 2.2.9.

The iOS and Android usage simply return the version string as supplied in the application configuration (eg 1.0, 2.3.5 and so on) - there's no string concatenation that takes place like it does in the Windows version. Therefore I'm unsure as to whether this should be "normalized".
What's the common Windows app convention (not having a Windows device myself) - to include the revision number or not?

From what I found here, it seems like on the windows platform, they are used to "3 dots" version strings. I also went and check my Device Portal which confirmed it.

However by normalizing, I meant keeping it consistent with what the plugin would return on another platform. In my config.xml, I have:
<widget id="com.example"  version="2.2.9" xmlns="http://www.w3.org/ns/widgets">
   ...
</widget>

So I would expect 2.2.9 to be returned.
Personally I would prefer if it returned the cordova version.
In the worst case, we could make another function to return the full version.
What do you think ?

@richsage ?

Hey there, Any updates on when this PR can be merged ?

Sorry - totally forgot :-) Yep, I'm happy with this!

Could you publish a 0.1.10 :smile: on npm please ?
Cheers

@richsage any update on the next npm release ?


Improve ergonomics of binaries

I feel like working with binaries in Rustler is not as convenient as it could be. Additionally, you have to jump through hoops to build a binary without unnecessary copies.
There are two things that we could improve:

Making OwnedBinary encodable. Optimally we would be able to return an OwnedBinary without having to manually release it.
Implement common traits like Write and Extend for OwnedBinary so it can be used directly with functions that write bytes.

For the first part, the problem is that the Encoder trait takes a &self, so there is no way that we can release the binary to be encoded. I think the encoder taking a &self probably makes sense, though I see no reason why we couldn't also encode by taking ownership in a rustler::nif decorated function.
The second part should be relatively straightforward, though we'd have to think about how to efficiently grow the binary as it's being appended.
This is something I could possibly work on, though I'm still not very familiar with the code so maybe I'm missing something. I'd like to hear your thoughts on this first.

Part 1 is pretty simple: Just implement NifReturnable on OwnedBInary like it's done here: https://github.com/rusterlium/rustler/blob/master/rustler/src/codegen_runtime.rs
For the second part, there is realloc_or_copy on OwnedBinary that could be used for this, though I'm not convinced this is ever a good idea. If you know the size up-front you can just get a cursor to the underlying slice to write on, if you don't know the size you are probably better of with building an IO list (as in a Vec<OwnedBinary> to be converted to an Erlang list of Binary) and passing that directly back without writing it all into the same buffer.
Nice ergonomics for building an IO list would be a great addition :)

Great, I'll prepare a PR for the first part.
As for the second part, conceptually you would do the same thing in Rust when you don't know the size up-front. You would create a new Vec, maybe give it some hint capacity, write to it and let it reallocate when needed. So unless there's a greater cost to reallocating binaries in BEAM, I don't see why not. Though IO lists are probably a more BEAM friendly solution. We'd have to do some tests comparing the cost of Vec/Binary reallocation I guess.

Vec grows exponentially (not strictly speaking guaranteed, but they promise an amortised O(1) push and AFAIK they realise this right now via a constant growth factor), realloc doesn't. This means a simple Write implementation based on a simple realloc to the new size will have very unfavourable growth behaviour. This could be countered by implementing an exponential growth strategy in OwnedBinary, but I'm not convinced having that kind of code in there is really helpful.
In C++ one could probably just override the allocator for std::vector, I don't think such a thing exists in Rust right now.


Perfection is required in permission model implementation

In Map fragment, it's showing "Insufficient permissions" snack bar when user denies but rather it should show a snackbar with action using shouldShowRequestPermissionRationale.

@the-dagger we have fixed out this issue so we can close this issue now. We are only using WRITE_EXTERNAL_STORAGE permission and for which we need user's permission. We have implemented permission model perfectly in map fragment.