before-finish function not working

Describe the bug
I wanted to use an ajax loader icon when I click the excel download button, and switch it back to static icon when download finished.
To Reproduce
download-excel
:fetch="json_data"
:fields="json_fields"
name="Kockázatok-leltár.xlsx"
worksheet="Leltár"
type="xlsx"
:before-generate="excelClicked"
:before-finish="excelDownloaded"
methods:{
...
excelClicked() {
this.$notify({ title: 'Előkészítjuk az excel fájlt', type: 'success' });
this.excelLoading = true;
},
	excelDownloaded() {
		console.log('download finished');
		this.$notify({ title: 'A fájl készen van', type: 'success' });
		this.excelLoading = false;
	},

...
}
Expected behavior
The "before-generate" works fine, I get the loader icon, but "before-finish" does not. So the icon never switches back to static icon.
Additional context
I'm using latest 1.0.29 package version in Vite/vue.js3
In your code I see
if (!data || !data.length) {
if (typeof this.beforeFinish === "function") await this.beforeFinish();
return;
}
Does this mean it's not supposed to work if I use :data instead of :fetch? Or is it not related?

Hi @AttiZK ,
Use 1.0.30 version. Let me know if it works.
Thanks,
Pratik Patel

Yes, this update seems to have solved it! Thanks a lot!


Invoice class

This is to create a model of an invoice at the header level. Future work will involve creating a separate class for an invoice line, and a class that retrieves the list of invoices returned from an API call.

Lines not currently tested:
Returning an invoice reference number when there is one
Returning invoice notes when there are any

@sandbergja Can you please review? This is similar to the invoice class used in lib_jobs, but I need a lot more data represented since this is going to be used to perform detailed analysis on invoices and orders.


How to relock weeks

Describe your problem here.
i was testing out my mod and i wanted to relock the weeks that unlocked<How can i do that?!?!?
Are you modding a build from source or with Lua?
Source
What is your build target?
Windows x64
Did you edit anything in this build? If so, mention or summarize your changes.
No response

Relock?  Just Edit The Week.json File I Think

i tried doing that but even when i lock it again it just shows up unlocked

i tried doing that but even when i lock it again it just shows up unlocked

send a video of the issue

https://user-images.githubusercontent.com/87683927/187011671-f33b1c15-4daf-48ec-9768-cb328702821e.mp4
Imma send its with 2 more flies to big

https://user-images.githubusercontent.com/87683927/187011728-533fed67-0314-4810-83b1-4760a78baa5e.mp4

so it still lets me play them even tho its locked

make custom weeks
or just press the R button to reset unlocking

they are custom and the r doesnt work (the prob is that we dont have some assets atm thats why it looks like that)

they are custom and the r doesnt work (the prob is that we dont have some assets atm thats why it looks like that)

you literally replaced it in the assets/weeks folder instead of the mods/weeks folder

no its because thats the folder i used for a template

and that's why you need to rename the weeks

Rename the week name needed to complete the week? And also rename the week needed to be unlocked the same name.


Label.from_category is O(num_classes) complexity, for every single sample

This function is called when loading every single sample, but its complexity is O(num_classes) because of the .index() call, which is probably overkill. A simple dict lookup should be enough and much faster here.
https://github.com/pytorch/vision/blob/96aa3d928c6faaf39defd846966421679244412d/torchvision/prototype/features/_label.py#L35-L43
CC @pmeier

I agree that there is a theoretical benefit, but does this an impact on a practical case? Benchmarking it on my machine gives me roughly 30 ns per category in categories. Meaning even for ImageNet (the dataset with the most categories we currently have on record) it takes roughly 30 µs for this call:
import random
import timeit

num_categories = 1_000  # maximum that we currently have
num_runs = 1_000_000

categories = list(range(num_categories))

total = timeit.timeit(lambda: categories.index(random.randint(0, num_categories - 1)), number=num_runs)

print(f"Looking up the category by index with {num_categories} total categories took {total / num_runs * 1e6:.1f} µs")

Your proposal means we should switch catgories attribute to a dictionary with the categories as keys and the index as value, correct? Do you want to keep the functionality to create a label with a categories sequence?

Categories are strings, not integers. String comparison will take much longer. I did observe a significant last time I benchmarked this

Makes no significant difference for me:
import random
from time import perf_counter_ns
import string

num_categories = 1_000  # maximum that we currently have
num_runs = 1_000_000

categories = ["".join(random.choices(string.ascii_lowercase, k=20)) for _ in range(num_categories)]

timings = []

for _ in range(num_runs):
    category = random.choice(categories)

    tic = perf_counter_ns()
    categories.index(category)
    tac = perf_counter_ns()

    timings.append((tac - tic) * 1e-9)

print(
    f"Looking up the category by index with {num_categories} total categories took "
    f"{sum(timings) / num_runs * 1e6:.1f} µs"
)

With string of 20 characters lookup is now linear with 4 ns, i.e. 4 µs for ImageNet.

import random
import string

str_len = 20
num_categories = 1000
batch_size = 512

categories = [''.join(random.choices(string.ascii_lowercase, k=str_len)) for _ in range(num_categories)]
mapping = {cat:i for (i, cat) in enumerate(categories)}
batch_targets = [random.choice(categories) for _ in range(batch_size)]

%%timeit
[categories.index(cat) for cat in batch_targets]

2.59 ms ± 62.6 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)

%%timeit
[mapping[cat] for cat in batch_targets]

14 µs ± 318 ns per loop (mean ± std. dev. of 7 runs, 100,000 loops each)

A few ms per batch is always good to take, especially considering how simple the solution is, and when we're trying to exhibit benefits of using datapipes over our current datasets. Data-loading speed will be the main factor for adoption.

Do you want to keep the functionality to create a label with a categories sequence?

Sorry, not sure what you mean here?

Right now we create the Label with a sequence of categories:
https://github.com/pytorch/vision/blob/2e70ee1af3bb3c5ba0f9a8bcf16cd1611831690f/torchvision/prototype/features/_label.py#L18
https://github.com/pytorch/vision/blob/2e70ee1af3bb3c5ba0f9a8bcf16cd1611831690f/torchvision/prototype/features/_label.py#L40
Do we want to keep this and only internally use dictionaries or should we switch to dictionaries everywhere? That would also mean that we need to touch the info dictionary of each dataset that provides categories:
https://github.com/pytorch/vision/blob/2e70ee1af3bb3c5ba0f9a8bcf16cd1611831690f/torchvision/prototype/datasets/_builtin/fer2013.py#L12-L17

I don't know yet, honestly. But I'm open to removing this categories logic altogether. We're still in prototype stage and our main focus is loading speed right now.


Update all Sample readme template

Updates to the sample readme template.
All samples should match.
### Tasks
- [ ] Finalize new template
- [ ] Update samples (add each here)
- [ ] Test samples with new readme (add each here)
- [ ] Publish

Closing so we can create new doc issues later.


Use module node16

This is the correct setting for modern code bases. It implies "moduleResolution": "node16" and "esModuleInterop": true.

Thanks!


🌈✅Improved Home page with new eco-friendly design🚀

This pull request is regarding the issue number : #1063
Closes #1063
Changes proposed
i improved whole home page with eco friendly theme ,in which all products are hand maded  then  according your requirements i made below changes in home page. And  also make it responsive for all devices.

Screenshots
Before Changes Home page looks like this :

After the Changes Home page looks like this :

Please merge this pull request

bro you need to create is using React so try to check it in file structure I have make seperate folder front-with-react

also take a look of readme file I have added a figma new design with eco friendly you can refer that design


Float cause duplicate alter table in all migrations

Bug description
I have such model
model Logbook {
  meter    Float?          @db.Float
  interval Float?          @db.Float
}

After I added these float fields, all my future migrations contains 'ALTER TABLE' for that:
ALTER TABLE [dbo].[Logbook] ALTER COLUMN [meter] FLOAT NULL;
ALTER TABLE [dbo].[Logbook] ALTER COLUMN [interval] FLOAT NULL;

How to reproduce

Use sql server
Add float fields to your model
Create migration

Expected behavior
Do change table only once
Prisma information
model Logbook {
  id             String          @id(map: "PK_Logbook") @default(uuid()) @db.UniqueIdentifier
  title          String          @db.NVarChar(50)
  description    String?          @db.NVarChar(Max)
  meter          Float?          @db.Float
  interval       Float?          @db.Float
  date           DateTime        @db.Date()
  modified       DateTime        @default(now()) @db.DateTime()
}

Environment & setup
OS: Windows
Database: Sql Server
Node.js version: 16.15.1
Prisma Version
3.15.1

I could reproduce the problem in tests and identified the cause — it will be fixed by https://github.com/prisma/prisma-engines/pull/3066, which will be in the next Prisma release (4.1). As a workaround in the meantime, you can replace @db.Float with @db.Float(53) to avoid the spurious migrations. Thanks for reporting this bug!


Document return value of NStepLSTM#call

https://github.com/chainer/chainer/blob/0f4b5f2f112818159a3e256826d95ab2b9fcdbae/chainer/links/connection/n_step_lstm.py#L90
had to look in the source to find out. I think this applies to all NStep links.

I think it's OK to leave this issue closed, as #4425 has already been merged.


Checkin for caching the template matching for significant route finde…

This PR includes a change that represents a significant improvement in both memory allocation and Op/s for matching URLs for routing requests. This is achieved by compiling the Regex used to match a route at template construction time instead of on the fly with each request. This allows the regex engine to optimize the pattern matching quite a bit. There was a change to the signature for IUrlPathToUrlTemplateMatcher needed to achieve this, but it is functionally the same. All tests are passing, though many tests had to be modified to use the new signature. Benchmarks attached below.
Fixes / New Feature #
Performance enhancements.
Proposed Changes
Prior to these changes, 3.29KB is allocated per request and 274K Op/s is achieved.

// * Summary *

BenchmarkDotNet=v0.10.14, OS=manjaro
AMD Ryzen 7 2700U with Radeon Vega Mobile Gfx, 1 CPU, 8 logical and 4 physical cores
.NET Core SDK=2.1.500
  [Host]     : .NET Core 2.1.6 (CoreCLR 4.6.27019.06, CoreFX 4.6.27019.05), 64bit RyuJIT
  DefaultJob : .NET Core 2.1.6 (CoreCLR 4.6.27019.06, CoreFX 4.6.27019.05), 64bit RyuJIT

   Method |     Mean |     Error |    StdDev |    StdErr |      Min |       Q1 |   Median |       Q3 |      Max |      Op/s | Scaled |  Gen 0 | Allocated |
--------- |---------:|----------:|----------:|----------:|---------:|---------:|---------:|---------:|---------:|----------:|-------:|-------:|----------:|
 Baseline | 3.643 us | 0.0096 us | 0.0085 us | 0.0023 us | 3.627 us | 3.636 us | 3.642 us | 3.651 us | 3.655 us | 274,525.0 |   1.00 | 6.4163 |   3.29 KB |

With these changes, only 96B is allocated per request and 10,876K Op/s is achieved.
// * Summary *

BenchmarkDotNet=v0.10.14, OS=manjaro
AMD Ryzen 7 2700U with Radeon Vega Mobile Gfx, 1 CPU, 8 logical and 4 physical cores
.NET Core SDK=2.1.500
  [Host]     : .NET Core 2.1.6 (CoreCLR 4.6.27019.06, CoreFX 4.6.27019.05), 64bit RyuJIT
  DefaultJob : .NET Core 2.1.6 (CoreCLR 4.6.27019.06, CoreFX 4.6.27019.05), 64bit RyuJIT

   Method |     Mean |    Error |   StdDev |    StdErr |      Min |       Q1 |   Median |       Q3 |      Max |         Op/s | Scaled |  Gen 0 | Allocated |
--------- |---------:|---------:|---------:|----------:|---------:|---------:|---------:|---------:|---------:|-------------:|-------:|-------:|----------:|
 Baseline | 91.94 ns | 1.862 ns | 4.773 ns | 0.5439 ns | 83.93 ns | 89.62 ns | 91.32 ns | 93.40 ns | 114.8 ns | 10,876,595.7 |   1.00 | 0.1826 |      96 B |

Great numbers, but what happens when the configuration is changed (and reload) after ocelot has been started?

It recreates the templates on configuration change. All the properties on the Template class were already effectively read only, so new template regex's are compiled every time they are recreated. The regex is tied to the existing constructor that was already used and that signature has not changed.

Great. Fine by me. It Seems I'm gonna be the first one to approve a PR. It feels kinda awkward.


Support ReactNode in ActionMenu.Overlay

Describe your changes here.
Add support for ReactNode as the child type in ActionMenu.Overlay so that conditional children can be rendered within an overlay.
Closes #2067
Screenshots
No visual changes
Merge checklist

[ ] Added/updated tests - current testing doesn't seem granular enough to warrant testing every possible prop type, I can add a test if it seems necessary though.
[x] Added/updated documentation
[x] Tested in Chrome
[x] Tested in Firefox
[x] Tested in Safari
[x] Tested in Edge

Take a look at the What we look for in reviews section of the contributing guidelines for more information on how we review PRs.

This looks pretty safe, can we test this with a canary build in memex just to be sure?

@siddharthkp sure, what is the process for that?

Ugh, canary release workflow was skipped on fork. Let's merge this into a branch in primer/react and continue from there


Request: Ability to complete OIDC flows when working in a Dev Container

The quite useful capability of performing OIDC login flows as part of a request is non-functional when run using VSCode DevContainers - all other functionality works as expected, performing requests from within the container.
The need would be for the extension to configure port forwarding for the callback server and launch the system browser in the HOST instead of inside the container, to complete the request.
I do not know off hand if this is even possible, but it would DRAMATICALLY improve the usability of the tool.
My current workaround is to manually forward port 3000 (has to be forwarded to the same port as in the container or this does not work) and copy/paste the auth url from the VSCode popup. Not really something that you want to do a lot.

For development I would recommend using vscode-httpyac.
I actually always use the client credentials flow in Docker containers for testing. This does not require any manual input and is therefore best suited for automated testing. Password Flow would also work. However, this means that you should set up a separate client on the OAuth server.
If this is not possible, one would have to trick, since a direct call of applications on the host is not possible. You would have to get open to use curl when calling the auth url (xdg-open is used with $BROWSER). Then you could redirect it to a local ExpressJS server, which can then use open to open the url on the host as well. You could also enable port forwarding via expressjs. But this is very fiddly and I then wonder what advantage there is to running httpyac in a devcontainer, since a setup must also be performed on the client.

@jrussellsmyth @AnWeber I think the following link might be a solution.  I'm currently setting things up, but did a prelim test by installing xdg-utils in my dev container, setting up an authorization_code request in httpyac, and it seemed to work OK so far.
https://github.com/microsoft/vscode-remote-release/issues/3540#issuecomment-1283885029


getUnbufferedRow() - memory usage

Version 4.x
When using the getUnbufferedRow() for mysql results it seems that the driver does not properly apply the appropriate logic.
According to php docs, the default result mode is: MYSQLI_STORE_RESULT
When performing unbuffered queries you need to use MYSQLI_USE_RESULT while executing the query method.
https://www.php.net/manual/en/mysqlinfo.concepts.buffering.php
A simple hack:
in file: /system/Database/MySQLi/Connection.php
Add property to class:  public $result_mode = MYSQLI_STORE_RESULT; // default
on line 329 in the execute method change:
return $this->connID->query($this->prepQuery($sql));
to:
return $this->connID->query($this->prepQuery($sql),$this->result_mode);
Then in model when you need unbuffered results you can set result mode: $model->db->result_mode = MYSQLI_USE_RESULT;
I have a query when run in buffered mode consumes 300mb.
Then when I use getUnbufferedRow() it still consumes 100mb.
After applying the above hack and setting $model->db->result_mode = MYSQLI_USE_RESULT; it only consumes 5mb.
Perhaps there is a better fix than the one I outline above but this seems to make huge improvements in memory usage.

I'm not familiar with these modes but if you've found a vast improvement that would translate into the framework, by all means please submit it as a Pull Request so we can consider incorporating it!

@sclubricants can you submit a PR so we can vet on your proposed changes?

I have never contributed before and have no idea what I'm doing. I tried the best I can and submitted as PR.
https://github.com/codeigniter4/CodeIgniter4/pull/4812

@sclubricants I haven't looked at your PR yet, but I'm proud of you for trying! Welcome aboard, contributor 😊

https://github.com/codeigniter4/CodeIgniter4/pull/4850

Fixed in 929e5c4.


[DevTools / JS / Get Started / (3) Paused On Correct Line]

Hey there -- I'm paused on line 1598 of a file called "onloadwff.js" -- I imagine it's a browser extension or something.

Ah yeah it was lastpass. Loaded an incognito window and it seems to be working now, but I'm on line 22
 if (getNumber1() === '' || getNumber2() === '') {

Ah -- when I step through it takes me through evaluating each of those.

Hey @trevor-coleman thanks for reporting! I really appreciate it.
Sounds like you figured it out? See this comment if not: https://github.com/google/WebFundamentals/issues/4311#issuecomment-286271346
Thanks to contributions like yours I updated the feedback response (the section that provided you the link to report an issue) describing how to get past this scenario :)


Implement repository for queue throttle config

This PR implements mysql repository for queue throttling configuration we're planning to add in the next release.

Thank you.


Test plugin does not map correctly

The test plugin does not seem to be mapping correctly. Stacktrace: https://pastebin.com/qJFiXsU9
I've tried using the special-gradle plugin on my own Spigot plugin, some things get mapped properly and others don't. It seems to struggle with cases where there are method overloads or instance variables of the same type with different generic parameters. Here are a couple examples I've noticed fail:
Attempting to access Registry.ENTITY_TYPE ends up getting remapped to an entirely different registry. Relevant stacktrace: https://pastebin.com/Gcic4p7j
Attempting to call PlayerConnection#send(Packet) ends up remapping to an overload of PlayerConnection#send(Packet, GenericFutureListener), possibly due to the same name. PlayerConnection#send uses the name send when obfuscated, but PlayerConnection#send(Packet, GenericFutureListener) is named a instead. Relevant stacktrace: https://pastebin.com/etKwct6k
I was unsure if this was an issue with the special-gradle plugin or one with SpecialSource/the mappings instead. I decided to report here first, but if it ends up being an issue with SpecialSource or the mappings I'll remake the ticket on the proper repository. Thanks.

This is indeed an issue with SpecialSource. All Special Gradle does is invoke SpecialSource to remap in an automated fashion.

This possibly is an issue related to the Special Gradle plugin. I tried using the same test plugin's code using Special Gradle and md_5's SpecialSource plugin with Maven. The Maven one works fine, but the Gradle one fails to remap everything properly.
Repository with examples: https://github.com/Esophose/MojangRemapTests


As an analyst, I want to retrieve a list of all cities in a region organized by their population from largest to smallest, so that I can use this information to assist the understanding of the demographic distribution across cities in a region.

Finished issue.


[Question] Do we need to cancel a StreamSubscription ?

I am still in the testing fase of this plugin but I am starting to like it. Thank you for your work.
I do have a question related to the functionality of this plugin:
I want to now if I have to manualy close a StreamSubscription or not.
So if you have a code that looks like this:
CombineInfo isolateInfo = await Combine().spawn((context) {
  print("Argument from main isolate: ${context.argument}");

  context.messenger.messages.listen((message) {
    print("Message from main isolate: $message");
    context.messenger.send("Hello from isolate!");
  });
}, argument: 42);

 StreamSubscription<Object?> workerSubscription = isolateInfo.messenger.messages.listen((message) {
     // your code to handle messages from isolate
    });

Is it required to close the StreamSubscription or when calling the method  isolateInfo.isolate.kill(); will also handle the closing of the StreamSubscriptions ?

Hello. Glad to hear it
All combine related stuff, streams included, will be closed when it's killed. So your subscription will be closed as well

Nice, thank you for the info.


Spell checked with CSpell

Spell checked corrections are limited to comments, log output and README.md.

Thank you very much!


How to achieve nested parameterized dependencies?

First check

[x] I added a very descriptive title to this issue.
[x] I used the GitHub search to find a similar issue and didn't find it.
[x] I searched the FastAPI documentation, with the integrated search.
[x] I already searched in Google "How to X in FastAPI" and didn't find any information.
[x] I already read and followed all the tutorial in the docs and didn't find an answer.
[x] I already checked if it is not related to FastAPI but to Pydantic.
[x] I already checked if it is not related to FastAPI but to Swagger UI.
[x] I already checked if it is not related to FastAPI but to ReDoc.

Example
Given the follow minimal working example, where Test1 and Test2 are parameterized dependencies (as described in https://fastapi.tiangolo.com/advanced/advanced-dependencies/). One parameter of Test2 should be forwarded to Test1 which should be injected into Test2.:
import uvicorn
from fastapi import Depends, FastAPI
app = FastAPI()

class Test1():

    def __init__(self, t1) -> None:
        self.t1 = t1

    def __call__(self):
        return self.t1

class Test2():

    def __init__(self, t2) -> None:
        self.t2 = t2

    def __call__(self):
        return Depends(Test1(t1=self.t2))

@app.get("/test/")
def test_call(test: str = Depends(Test2(t2='test'))):
    return test

if __name__ == "__main__":
    uvicorn.run("main:app", host="<IP_ADDRESS>", port=8000, reload=True, debug=True)

Description
It is not possible to include Test1 as dependency in the call parameters of Test2 since there wouldn't be any access to the parameter of Test1.
Directly calling Depends as in the example above also does not work since there does not seem to be any dependency injection at this level.
How to achieve this kind of nesting? Is this simply not possible at the moment? If not, I would like to add this as feature request.
Environment

OS: Windows:
FastAPI Version 0.58.0
Python version: 3.7

you could add a Test1 instance in Test2.__init__
you could get an instance as input like : Depends(Test2(t2='test2', test1=Test1(t1='test1')))
or you can create one in __init__ like:
class Test2():

    def __init__(self, t2) -> None:
        self.t2 = t2
        self.test1=Test1(t1=t2)

@ihakh This does not provide any dependency injection to the __call__ method of Test1. Getting this to work with dependency injections is the point of this question / feature request.

Hey @Spenhouet, thanks for the interest.
I think I'm having a bit of trouble understanding the use case. I think I can imagine simple ways to solve it without requiring support for that, but I'm probably missing details of your use case.
For example, this seems to work:
import uvicorn
from fastapi import Depends, FastAPI

app = FastAPI()

class Test1:
    def __init__(self, t1) -> None:
        self.t1 = t1

    def __call__(self):
        return self.t1

class Test2:
    def __init__(self, t2) -> None:
        self.t2 = t2

    def __call__(self):
        return Test1(t1=self.t2)()

@app.get("/test/")
def test_call(test: str = Depends(Test2(t2="test"))):
    return test

if __name__ == "__main__":
    uvicorn.run("main:app", host="<IP_ADDRESS>", port=8000, reload=True, debug=True)

It seems my issue left out a crucial detail which must have seemed obvious to me when I created that issue.
Test1 and Test2 should be provided with dependency injection. Test1 should not be a simple class as in your code example.
The crucial detail I missed to specifically mention is that I would like to have dependency injection available in the call method of Test1 while also having it parameterized via Test2.
For example, the call method of Test1 should have parameters like request available:
class Test1():

    def __init__(self, t1) -> None:
        self.t1 = t1

    def __call__(self, request: Request):
        return self.t1

My use case gets more clear when looking at the following syntactically wrong example of what I would have liked to do:
class Test2():

    def __init__(self, t2) -> None:
        self.t2 = t2

    def __call__(self, test1 = Depends(Test1(t1=self.t2))):
        return test1

But this is not possible in python since self isn't available at this point.
My thought process was that I might be able to perform the dependency injection via the Depends wrapper outside the parameters directly in the code.
def __call__(self):
        test1 = Depends(Test1(t1=self.t2))
        return test1

But this does not execute as expected. This just returns an object but does not actually execute the call method of Test1 like it is done when it is included as parameter.

Could you do something like this instead?

    def __call__(self, test1 = Depends(Test1())):
        test1.t1 = self.t2
        return test1

Without knowing your actual use case, it's difficult to suggest possible solutions

@Mause No, that would not make sense since the call method of Test1 would then be called before t1 would be assigned.

Ok, how about something like this?

from fastapi.testclient import TestClient
from fastapi import Depends, FastAPI, Request
from rarbg_local.singleton import get

app = FastAPI()

class Test1:
    def __init__(self, t1) -> None:
        self.t1 = t1

    def __call__(self, request: Request):
        return self.t1

class Test2:
    def __init__(self, t2) -> None:
        self.t2 = t2

    async def __call__(self, request: Request):
        test1 = await get(
            request.app, lambda item=Depends(Test1(self.t2)): item, request
        )
        return test1

@app.get('/')
def thing(t=Depends(Test2('thing'))):
    pass

tc = TestClient(app)
tc.get('/')

With the missing piece here: https://github.com/Mause/media/blob/master/rarbg_local/singleton.py#L14

I will try to give an additional more complete and more clear explanation.
Starting with the scenario where you have nested dependencies:
import uvicorn
from fastapi import Depends, FastAPI, Request

app = FastAPI()

def sub_dependency(request: Request) -> str:
    return request.method

def main_dependency(sub_dependency_value: str = Depends(sub_dependency)) -> str:
    return sub_dependency_value

@app.get("/test/")
def test_endpoint(test: str = Depends(main_dependency)):
    return test

if __name__ == "__main__":
    uvicorn.run("main:app", host="<IP_ADDRESS>", port=8000, reload=True, debug=True)

Notice how sub_dependency can use dependency injection to get for example the request object.
Dependencies can also be written like classes instead of methods. The above example can be written like this:
import uvicorn
from fastapi import Depends, FastAPI, Request

app = FastAPI()

class SubDependency():

    def __init__(self) -> None:
        pass

    def __call__(self, request: Request) -> str:
        return request.method

class MainDependency():

    def __init__(self) -> None:
        pass

    def __call__(self, sub_dependency_value: str = Depends(sub_dependency)) -> str:
        return sub_dependency_value

@app.get("/test/")
def test_endpoint(test: str = Depends(MainDependency())):
    return test

if __name__ == "__main__":
    uvicorn.run("main:app", host="<IP_ADDRESS>", port=8000, reload=True, debug=True)

Notice that nothing changed. It is just a different syntax.
Now you can have parameterized dependencies. This allows you to have some generic dependency which changes its function based on the provided parameter. For example lets add a parameter type to MainDependency:
import uvicorn
from fastapi import Depends, FastAPI, Request

app = FastAPI()

class SubDependency():

    def __init__(self) -> None:
        pass

    def __call__(self, request: Request) -> str:
        return request.method

class MainDependency():

    def __init__(self, type: str) -> None:
        self.type = type

    def __call__(self, sub_dependency_value: str = Depends(SubDependency())) -> str:
        return self.type + sub_dependency_value

@app.get("/test/")
def test_endpoint(test: str = Depends(MainDependency(type="Customer"))):
    return test

if __name__ == "__main__":
    uvicorn.run("main:app", host="<IP_ADDRESS>", port=8000, reload=True, debug=True)

Now image I already have a nested dependency structure but to reduce redundancy I would like to have a more generic parameterized sub dependency. For this I would need to pass the parameter through the main dependency. That is what I can't solve at the moment.
My code are just minimal examples of the issue at hand. There can be much deeper nesting than just main and sub as in the example above. I don't want every hosting dependency to provide / carry all parameters which the sub dependency needs. That would miss the point of having dependency injection. The usage of the request for the injection or the parameter type is also just an example. I would like to have full dependency injection access on the sub dependency.

I'm afraid you haven't given an example that can't be solved with the method I supplied above - perhaps you'd like to give a concrete example rather than a theoretical one?

It seems it is still not clear. This is not a theoretical example. This is actually a very practical example. I stated above why your suggestions do not work. I don't see how your example provides dependency injection. You are simply passing along the parameters. That is not dependency injection. Maybe we have a different understanding of a what a injector is supposed to do.
I can't make it more clear since this would simply require me to solve the problem which most probably is not possible at the moment. That is why this is a feature request and not a bug report.

Well, I'm actually not aware of any dependency injection systems that support what you are asking for. Perhaps you could show us one that has the feature you're asking for and we could look at implementing it?

I partially misunderstood what your code example above did. I did not test it before since I did not have you code (singleton.py).
async def __call__(self, request: Request):
        test1 = await get(request.app, lambda item=Depends(Test1(self.t2)): item, request)

I thought you were just passing in the request object which was required in the sub dependency of my example and therefore didn't expect it to perform dependency injection on everything else - hence my statement "You are simply passing along the parameters.".
But your code does actually resolve the dependency injection. That is what I would have expected of Depends to do on its own. I also think it would be nicer it passing request wouldn't be necessary.
async def __call__(self, request: Request):
        test1 = Depends(Test1(self.t2))

One thing I thought of that would make it a bit nicer would
class ParameterizedDepends:

    def __init__(self, dependency) -> None:
        self.dependency = dependency

    async def __call__(self, request: Request):
        param = yield
        yield await get(request.app, lambda item=Depends(self.dependency(param)): item, request)

class Test1:

    def __init__(self, t1) -> None:
        self.t1 = t1

    def __call__(self, request: Request, orderId: str = Query(...)):
        return self.t1

class Test2:

    def __init__(self, t2) -> None:
        self.t2 = t2

    async def __call__(self, test1=ParameterizedDepends(Test1)):
        return test1.send(self.t2)

But this doesn't exactly work as expected. ParameterizedDepends is not picked up the same way a Depends.
Providing a functionality like this would already improve the situation.
One issue that remains is that the init of the dependencies it not called during start up but on call. This defeats any caching etc. happing there.
But again, passing on the parameter through the nesting seems to be not possible by the way python works. Not sure if this is even doable.
The best thing would be if
def __call__(self, test1=Depends(Test1)):
        return test1

could just pass along the parameter in some way. I currently have no idea on a possible design or technical solution.
Having something that allows the deliberate execution of Depends as you proposed would already be an improvement. It would at least enable the dependency injection for parameterized sub dependencies which currently isn't possible.

It doesn't take much work to get your example working:

from typing import Callable, TypeVar
from fastapi.testclient import TestClient
from fastapi import FastAPI, Request, Query
from fastapi.params import Depends
from rarbg_local.singleton import get

app = FastAPI()

class ParameterizedDepends(Depends):
    def __init__(self, dependency) -> None:
        self.real_dependency = dependency
        super().__init__(self.__call__)

    async def __call__(self, request: Request):
        async def internal():
            param = yield
            yield await get(
                request.app,
                lambda item=Depends(self.real_dependency(param)): item,
                request,
            )

        value = internal()
        await value.asend(None)
        return value

class Test1:
    def __init__(self, t1) -> None:
        self.t1 = t1

    def __call__(self, request: Request, orderId: str = Query(...)):
        return self.t1

class Test2:
    def __init__(self, t2) -> None:
        self.t2 = t2

    async def __call__(self, test1=ParameterizedDepends(Test1)):
        return await test1.asend(self.t2)

@app.get('/')
def thing(t=Depends(Test2('thing'))):
    pass

tc = TestClient(app)
tc.get('/', params={'orderId': '1'})

@Mause Nice!
This can probably even further improved by removing the need to async and by hiding the asend to a function call like test1(self.t2).
This would allow a relatively clean solution.
@tiangolo Might this be something that can be integrated like this or in a similar form? Currently there is no build in way to use nested parameterized dependencies with dependency injection. The main benefit is a cleaner code with less redundancy (more code reuse). The code necessary for the solution above is a total overkill for a "workaround" like solution. We would never put something like this in our code. But if there would be a build in method like ParameterizedDepends, we for sure would use it.
The solution above does enable dependency injection in nested parameterized dependencies. The only draw back is that init methods of the parameterized sub dependencies are executed at call time and not at application start. I currently don't see a way how this could be solved since it seems to clash with how python works in its self.

Honestly, I'm yet to see a reasonable use case for such a feature? It seems fairly arbitrary, and hence unlikely to be included in fastapi's core.
The examples you have given so far as well don't seem real world to me either - perhaps you can give an example from your own problem domain?
In the end, there is nothing stopping you from taking the above code and creating and publishing a package to pypi for your own use, or simply having it as a module in your own code.

I don't really get what you are asking for. To me you questions sounds like "why do you need parameterized dependencies?". If that is so not practical, why did you include that in fastapi?
The issue here is simply that currently parameterized dependencies do not work as sub dependencies. This really limits there usability. For us parameterized dependencies are very useful, that probably why you included them in fastapi in the first place.

That is indeed my question - parameterized subdependencies do not currently exist in fastapi, please help us understand why you need them?

So you are saying that there is a use case for parameterized dependencies but not for parameterized subdependencies? Why do you think the use case of parameterized dependencies only applies for the first level?
For us this use case has nothing todo with the level they are in. There are use cases for parameterized dependencies (e.g. for generalized dependencies). We simply want to be able to use them at any level. I don't get why that should be unreasonable to expect.

Please understand that fastapi has no support for parameterized dependencies at all - that feature exists purely by coincidence, because python allows you to define classes that fastapi considers functions, and which hence work with the Depends functionality.
All I ask is that you demonstrate your need.

I didn't know, thanks for the hint. Since there is a specific documentation page for parameterized dependencies (https://fastapi.tiangolo.com/advanced/advanced-dependencies/#parameterized-dependencies) I was expecting it to be a "feature" of fastapi. I'm aware of the technical detail.
One example: We have a dependency that verifies JWTs. Now we have different type of JWTs (customer and product) and they also connect to a respective database table which the content of the JWT is authenticated against. But the general logic is always the same. In comes a JWT and as input to a method (output of a dependency) we would like to have the database object (i.e. customer or product object). Now we need to only provide information like the header field to read and the database table to use to these generic verification and authentication methods. These methods should also independently be useable. That requires a nested parameterized dependency.

I mean this
import uvicorn
from fastapi import Depends, FastAPI, Request

app = FastAPI()

class SubDependency():

    def __init__(self) -> None:
        pass

    aync def __call__(self, request: Request) -> str:
        return request.method

class MainDependency():

    def __init__(self, sub) -> None:
        self.sub=sub

    async def __call__(self, request: Request) -> str:
        return self.sub(request)

@app.get("/test/")
def test_endpoint(test: str = Depends(MainDependency())):
    return test

if __name__ == "__main__":
    uvicorn.run("main:app", host="<IP_ADDRESS>", port=8000, reload=True, debug=True)

I have a concrete example of where this would be especially useful for me.
I use a package called armasec to provide auth via an OIDC platform with RBAC. It validates a jwt and extracts a payload into a Pydantic model called TokenPayload like so:
guard = Armasec("foo-domain.us.auth0.com", audience="https://bar-api.baz.com")

@router.get("/foo")
async def get_foo(token_payload: TokenPayload = Depends(guard.lockdown("foo:read"))):
    """
    Do stuff with the TokenPayload instance
    """

Now, we also have some custom claims embedded in our JWT that we also like to extract. We use a function to do the extraction/validaton. This looks something like this:
class CustomClaims(BaseModel):
    user_email: EmailStr
    user_full_name: Optional[str]
    org_name: Optional[str]

def custom_from_payload(payload: TokenPayload):
    return CustomClaims(**getattr(payload, "custom_claim_key"))

When we use this in an endpoint, the code looks like:
@router.get("/foo")
async def get_foo(token_payload: TokenPayload = Depends(guard.lockdown("foo:read"))):
    custom_claims = custom_from_payload(token_payload)
    # now do something with custom_claims.email or something

It would be very nice if we could cleanly re-write custom_from_payload() to use dependency injection so that the implementation was more like:
@router.get("/foo")
async def get_foo(
    custom_claims: CustomClaims = ChainedDepends(
        guard.lockdown("foo:read"),
        extract_custom_claims,
    ),
):
    # now do something with custom_claims.email or something

This would be especially useful because we are doing the claim extraction in our endpoint methods all over the place and it would be slick to roll it into a single dependency injection invokation. It seems like this might not be very straightforward to implement at all. But, here's a concrete use-case.

I'm not 100% sure it's the same use case / issue, but it's fairly similar and may be helpful to someone so I'll leave it here
I wanted to be able to override args passed to Depends without having to manually track down and handle every arg or send something async so I spun up a fork here:
https://github.com/tiangolo/fastapi/compare/master...liquet-ai:master
Usage is like this (showing that it works with Security as well as Depends):
from fastapi import FastAPI
from fastapi.dependencies.models import Overrides
from fastapi.param_functions import Depends, Security

app = FastAPI()

def Inner(overrides: Overrides, orderId: str):
    print(overrides)
    return orderId

def OuterOverride(inner=Depends(Inner, overrides=Overrides(orderId=2))):
    return inner

def OuterNoOverride(inner=Security(Inner)):
    return inner

@app.get("/")
def overriden_dependency_args(
    order_id=Depends(OuterNoOverride),
    overridden_order_id=Security(OuterOverride),
):
    return overridden_order_id, order_id

and output will be like this:
[2,"1"]


FTCPad

If I could have a black pcb and a red bottom case that'd be great!

Looks good to me! Great job. Get your hackpad here: https://forms.hackclub.com/hackpad


Added property attriubutes

This silences warnings for projects built for iOS >

8.0

Thanks a lot @danipralea! :+1:

absolutely! My pleasure!


Setup CI

Test build on my fork:
https://ci.centos.org/job/sandcastle-master/21/
CI jobs:
https://ci.centos.org/job/sandcastle-master
https://ci.centos.org/job/sandcastle-pr

Merging:
https://ci.centos.org/job/sandcastle-pr/3/


ndc_to_world seems to have wrong output range in documentation

How can Bevy's documentation be improved?
Inside of bevy_render/src/camera/camera.rs, the following documentation for ndc_to_world states:
    /// Given a position in Normalized Device Coordinates,
    /// use the camera's viewport to compute the world space position.
    ///
    /// When the position is within the viewport the values returned will be between -1.0 and 1.0 on the X and Y axes,
    /// and between 0.0 and 1.0 on the Z axis.
    /// To get the world space coordinates with the viewport position, you should use
    /// [`world_to_viewport`](Self::world_to_viewport).
    ///
    /// Returns `None` if the `camera_transform`, the `world_position`, or the projection matrix defined by [`CameraProjection`] contain `NAN`.
    ///
    /// # Panics
    ///
    /// Will panic if the projection matrix is invalid (has a determinant of 0) and `glam_assert` is enabled.

I believe this should state:
    /// When the position is within the viewport the values returned will be between `-world_max_width/2.0` and `world_max_width/2.0` on the X axis, `-world_max_height/2.0` and `world_max_height/2.0` on the Y axis, and between `0.0` and `world_max_depth` on the Z axis.
    /// where `world_max_width` is the maximum world width, `world_max_height` is the maximum world width, and `world_max_depth`
    /// is the maximum depth, in units (by default, pixels) defined by the user.

For reference, when running the above code in my world, I can definitely get it to be outside the -1.0 to 1.0 bounds. It seems like this is an input constraint, not an output constraint, though I wanted to be sure before I posted a PR.

For some additional context, ndc_to_world() seems like it should take, as input normalized device coordinates (-1.0 to 1.0) and output world coordinates (which, by default, for a 2D scene, should be pixels, correct?)


Multilingual-press an polylang 2.1.1 together

Version Information

WordPress: 4.7.2
MultilingualPress: latest 2.5.2

Steps to Reproduce
I have to use Multilingual-press an polylang 2.1.1 together in a multisite installation. Multilingual-press can only be used network-wide. I there a possibilty to only aktivate Multilingual-press on some multisite page ID ´s
thanks for help

Hi,
MultilingualPress can only be activated network-wide, yes. However, it is only active on sites that have a (MutlilingualPress) language assigned and are related to at least one other site.
Does that help?
Cheers,
Thorsten


Neo4j Country , State , City modelling

I'm a building a registration form for my website(it is using Neo4j) and need to populate the country, state and city field. All these fields are inter-linked i.e depending on country, state field will be set and depending on state city will be set. I'm trying to figure out what's the best approach to model this using Neo4j.

Good luck!


Calibration Pattern

Hello,
i have a DVS128 from inilabs.
Is it possible to acquire  a calibration pattern somewhere or do i have to build one myself ?

As far as I know, you cannot buy such a pattern anywhere, but it should not be too difficult to build that yourself with, e.g., an arduino Otherwise, you can use your screen to show a blinking pattern, as described here in Section III: http://rpg.ifi.uzh.ch/docs/IROS14_Mueggler.pdf

Thank you for your reply. I will try it. I did read somewhere else that someone managed to calibrate a Davis Camera with a checkboard would hat work as well?

Yes, the DAVIS also outputs conventional image frames that you can use for standard camera calibration. Since the same physical pixel is used for both the frames and the events, the image-based calibration also holds for the events. We only use the LEDs for the DVS128; for the DAVIS we use the images.

Thank you again. I have a few mor questions.
Can I use white led for my calibration pattern or schould i use infrared led?
I guess the led schould all blink at the same time.
Is the background colour of the led mount of any importance?
I will try and build one this weekend.
I apreciate your help verry much.

Yes, they should blink at the same time. I would go for visible LEDs, but infrared might work too. The background should not be reflective, but otherwise it does not matter.

I made a5x5 pattern with an arduino. It worked like a charm thank you again.


some refactor in BaseCommand class

The code currently modifies the $model variable in place several times. While this is not necessarily a problem, it can make the code harder to follow. Consider using separate variables for the modified versions of $model, rather than overwriting it each time.
using the DIRECTORY_SEPARATOR constant. This can make the code more portable between different operating systems.
it returns only a string instead of an array or a string, since the is_dir() check is only needed to determine the namespace to use.

The source code you have modified is taken from the Laravel Core (see here), and I believe they are experienced than us in this aspect.
This does not mean that your solution is less effective, it's just that I think it should stay as it is.
Thank you very much for your effort, if you see any other shortcomings, do not hesitate to contribute. Or if you want to discuss this topic!


RawGit is shutting down and is used for some docs

There are a few references to rawgit HTML pages https://github.com/MicrosoftDocs/azure-docs/search?q=rawgit&unscoped_q=rawgit (so I didn't report it individually on the pages)
@zhouwangzw maybe you could see if the Microsoft/Cognitive-Speech-STT-iOS repo could turn on GitHub pages, or just migrate the content to the docs repo

@nschonni Thanks for the feedback! I have assigned the issue to the content author to investigate further and update the document as appropriate.
@zhouwangzw Can you please check this issue? Thanks a lot!

We have published new Speech SDK: https://docs.microsoft.com/en-us/azure/cognitive-services/speech-service/. The Bing Speech service and related SDKs, which include the one mentioned here, are being deprecated. We recommend users of legacy SDKs to use the new Speech service. Please refer this https://docs.microsoft.com/en-us/azure/cognitive-services/speech-service/how-to-migrate-from-bing-speech for migration details.
Thanks,

@nschonni We will now proceed to close this thread. If there are further questions regarding this matter, please respond here and @YutongTie-MSFT and we will gladly continue the discussion.

@zhouwangzw @YutongTie-MSFT think this probably should stay open till those articles are switched from the RawGit urls to the new site

@nschonni Sure.

#please-close
@nschonni - It looks like RawGit will support existing documentation through October 2019. As this is the same point that Bing Speech Service will be retired, there are no plans to migrate documentation to a different platform. If at the time both services are deprecated you encounter any issues, please feel free to re-open this ticket and we will re-evaluate. Thanks again for bringing this up.

@nschonni We will now proceed to close this thread. If there are further questions regarding this matter, please tag me in your reply. We will gladly continue the discussion and we will reopen the issue.


settinngs: added warning notification for file upload.

closes https://github.com/inveniosoftware/invenio-communities/issues/741

Form is automatically submitted when the user uploads a community logo.
Added a warning message under logo upload box.
Message is only shown when the form is considered dirty, e.g. when the user edited the form.

When form is not edited yet:

When form is dirty, e.g. edited but not saved yet:

Note: this is not final, as other suggestions arose from discussion. E.g. displaying the same warning message in a modal when the user clicks Upload new picture.

Since we decided not to use this implementation, I am closing  this Pull Request


moving off LFS

move test_data of repository and move to zenodo for external download, instructions to link up

After posting to three different Slack channels, the best idea I've gotten is to move the data to Cloudflare:
A possibility would be to investigate cloud storage. E.g. hosting the data in a public Cloudflare R2 bucket (https://www.cloudflare.com/products/r2/) should be pretty affordable, and it can just be downloaded as needed. It's much cheaper than LFS for pricing (1.5 c / GB / month storage, 36 c / million read operations, no bandwidth cost) - the test script would then just download the data as needed.

Adam is going to discuss with John Rayner what he prefers from an IRTF perspective.

In #112 , I've moved the test_data directory to a dedicated repository. This should minimize the LFS bandwidth. I think this should resolve a lot of the concerns.


How to handle lookup fields? [Question]

Formly looks great and I might need to explore the documentation once more, but I'm wondering how to handle lookup fields.
Simple examples:

dropdown or autocomplete with countries
an order screen where I want to select a customer, so the customer field (eventually showing the name of the customer) needs a [...] button next on the right with an ng-click triggering a custom action (in this case a new window for selecting the customer)

Hi @paulvanbladel,
Both of these would require a custom type. There's an example of how to do this on the website. For the custom action, your type could specify a controller which would add the custom action to the $scope (here's an example of that).

Thanks Kent, I'll look into that.

Hi @paulvanbladel! Did you get this working? Does this need to remain open?

I take it you got this working? Great! :D Let me know if there's anything more I can do!

@kentcdodds can you make an example of autocomplete ??

@abodacs, an autocomplete component is pretty complex. There are libraries that allow you to do it pretty easily. Is there a particular library you'd like to see an example of integration with formly?

@kentcdodds i accept any library :) and it would be great if it was in edit mode.

and it would be great if it was in edit mode.

I'm not sure what you mean by this...

Here you go: http://angular-formly.com/#/example/other/ui-bootstrap-typeahead

my use case i have form has autocomplete populated from api . i mean by "edit mode" how can i populated the autocomplete field again when user want to edit it.

Can we have an example of how to handle dynamically loaded data into typeahead instead of data that is included?

@CodeLiftSleep
https://gist.github.com/eyston/5851760 may help

I actually created my own example...I basically merged the example for Async Select and UI-Bootstrap and got it working...
Here is a much better typeahead example with UI BootStrap using dynamic data:


Usage in TypeORM transformer

Issue type:

[x] question
[ ] bug report
[ ] feature request
[ ] documentation issue

nestjs-config version
1.4.5
@nestjs/common+core or other package versions

@nestjs/common: 6.10.12
@nestjs/core: 6.10.12

Hey, great work on this module! I have a common use case - encrypting/decrypting data when going in and out of the database using typeorm transformers:
Contrived example:
@Column({
    nullable: false,
    type: 'text',
    transformer: {
         from(value: string) {
              return decrypt(value, configService.get('privateKey'))
         },
         to(value: string) {
              return encrypt(value, configService.get('publicKey'))
         }
    }
 })
bankAccountRoutingNumber: string

Unfortunately, I don't believe that the transformer definitions have access to the DI container, so I have to create a separate instance of ConfigService for this use case only as far as I know. Is there any way to use the ConfigService instantiated by the DI container for TypeORM transformers?

That's a good question. I don't believe there is a method to handle this other than creating a subscriber to handle the encryption on insertion and using a getter with class-transformer to transform the value. not ideal but it would work! The alternative unfortunately is loading the dotenv config method before importing this file. Can be done by running ConfigService.load before importing your entities

Ok no worries! I figured as much. I think for now I'll just continue to export a separate instance of ConfigService that isn't managed by DI just for the transformers. It's not really too inconvenient given that having that encrypt/decrypt operation in my tests is harmless. Feel free to close if you'd like!


Add pipeline for custom events

Fortis-v1 has a feature where users can upload custom events and have them analyzed via the Fortis pipeline. See publishEvents for reference.
If we want to support this feature in Fortis-v2, we need to add a pipeline via which to ingest these custom events.
One possible implementation of this is to use EventHub with the Spark pipeline acting as a consumer and the resolver that implements publishEvents acting as a producer.
We already have code to interface with EventHub from Spark (EventHubStreamFactory) so it shouldn't take more than 1-1.5 days to build all the required pieces:
(1) Define the schema for the custom events
(2) Define a name for the custom events EventHub
(3) Add a new pipeline that processes events from EventHub
(4) Set up a dummy EventHub in our Azure subscription for testing

Adding @erikschlegel to give thumbs-up/down on whether we want to implement this.

Your assumption is spot on. For custom events today, we push those messages into event hub which leverages the same flow as tadaweb. 👍

Fitting into step (3) above, StreamProvider was designed with this in mind :) Just need to add a model and adapter for custom events and then attach another EH stream factory to our provider instance to add support:
.withFactories(
  List(
    new EventHubStreamFactory("CustomEvent", CustomEventAdapter.apply,
      settings.progressDir)
  )
)

We'll define a CustomEvent pipeline as mentioned in (3) as well.

I can take this one tomorrow morning.

Branch for putting custom events onto the EventHub: publish-events-resolver.

Branch for consuming the custom events from the EventHub: customevents.


Duplicate heading is created

What version of the plugin are you having the issue with?
1.2.2
Issue description

Possibly because of the way the plugin handles alternate heading syntax, it sometimes creates another duplicate heading.
Additional information
How to reproduce the issue
To reproduce this issue, try formatting this example input.
## Dynamic Arrays (ex: Python `list`)
-

You'll get the following output:
## Dynamic Arrays (ex: Python `list`)

## Dynamic Arrays (ex: Python `list`)
-

Pull request #21 merged.

Pull request https://github.com/polyecho/formatto/pull/21 merged.


Terraform Based Randomized Variables

Benefit/Result/Outcome
As an IT Administrator deploying Terraform via the CLI, if I don't provide a modified TFVARS file, terraform should still deploy a generic MLZ deployment, with required random names.
Description
Part of the bash script functionality provides unique resource names for groups and Azure wide specific random names.  In order to replace this functionality we need to make use of the 'random' or 'time' based providers from Terraform.
Acceptance Criteria

When invoked, Terraform templates provide their own unique names for required components during deployment.

One line Terraform deployment, no longer needed.


Enable mediator mode on the persistent queue

It appears we've had the mediator's persistent queue misconfigured for some time.  This update addresses that issue.
Fixes: #38

I've deployed these changes to our dev environment.  Let me know if you'd like it deployed to test as well to make testing easier.
cc @cvarjao, @jleach, @esune, @jamshale

@esune, @swcurran, Any benefit to running some performance tests on the updated configuration to see if it makes any improvements?

@WadeBarnes I'll switch to dev today and test.

I can run an Aries Akrida test now using Dev.  I assume the invitation is still the same — I’ll let you know if that is an issue.

Ran a test and had decent speed, but there were errors happening.  @WadeBarnes — could you please check the logs of the components (Traction Test, Mediator Dev) to see if you see anything.  Timing of the tests is in image below.
Looks like the OpenShft pods stopped responding at times — hence the 502 errors.  I suspect that the last error was a byproduct of the 502 errors.
44	TYPE	/load-agent/load-agent/locustMediatorVerifier.py_presentation_exchange	Exception('Encountered JSONDecodeError while getting the presentation record: ', <Response [502]>)
21	TYPE	/load-agent/load-agent/locustMediatorVerifier.py_presentation_exchange	Exception('Request was not successful: ', b'\r\n<title>502 Bad Gateway</title>\r\n\r\n
502 Bad Gateway
\r\n
nginx/1.24.0\r\n\r\n\r\n')
1	TYPE	/load-agent/load-agent/locustMediatorVerifier.py_presentation_exchange	KeyError('verified')

Another test — this time just connecting/issuing (so heavier use of Mediator and more happening per loop).  Again, a decent rate — about 190 issues/minute — but some errors.
1	TYPE	/load-agent/load-agent/locustMediatorIssue.py_accept_invite	Exception('Error encountered within load testing agent: ', {'error': 1, 'result': 'Connection timeout!'})
76	TYPE	/load-agent/load-agent/locustMediatorIssue.py_accept_invite	KeyError('connection')
8	TYPE	/load-agent/load-agent/locustMediatorIssue.py_get_invite	JSONDecodeError('Expecting value: line 1 column 1 (char 0)')
9	TYPE	/load-agent/load-agent/locustMediatorIssue.py_receive_credential	Exception(b'\r\n<title>502 Bad Gateway</title>\r\n\r\n
502 Bad Gateway
\r\n
nginx/1.24.0\r\n\r\n\r\n')
5	TYPE	/load-agent/load-agent/locustMediatorIssue.py_receive_credential	Exception('Error encountered within load testing agent: ', {'error': 1, 'result': 'Credential timeout!'})
1	TYPE	/load-agent/load-agent/locustMediatorIssue.py_receive_credential	Exception(b'403: Connection cc48c03c-f331-4bbf-90ee-dde1b8f96e2c not ready')
1	TYPE	/load-agent/load-agent/locustMediatorIssue.py_receive_credential	Exception(b'403: Connection b1c5f9e1-4d36-40ce-bfbb-730b09c117f2 not ready')
1	TYPE	/load-agent/load-agent/locustMediatorIssue.py_receive_credential	Exception(b'403: Connection 936efb51-a85d-4f6b-b056-9866c008fc9f not ready')
1	TYPE	/load-agent/load-agent/locustMediatorIssue.py_receive_credential	Exception(b'403: Connection e62daa08-7d2c-471f-a9c5-ccc47b8be536 not ready')
1	TYPE	/load-agent/load-agent/locustMediatorIssue.py_receive_credential	Exception(b'403: Connection 4ba58762-3014-4f33-a1d6-fd74afd7e971 not ready')

Attached are the logs for the mediator.  Some errors in there some may be a problem, others not.
aries-mediator-agent-82-6w98v.log
It looks like you may have ended up getting connected with a newly spawned aca-py instance at one point that was heavily throttled for a while:

The configuration has been promoted to test.
cc @jleach, @swcurran

@WadeBarnes, @esune — what do you want to do about the logs?  It seems to me the resources applied to the Dev Mediator instance should be adjusted and then I run the test again to see what happens?  There is nothing I can contribute through reading the logs.

@WadeBarnes is there anything we should do to avoid a similar scenario (e.g.: throttling) or is it a scenario that may occur again if events line-up the same way regardless of how much cpu/memory we give the service? It kind of sounds like the throttling could have been due to startup operations and now it might not cause issues again?

@WadeBarnes is there anything we should do to avoid a similar scenario (e.g.: throttling) or is it a scenario that may occur again if events line-up the same way regardless of how much cpu/memory we give the service? It kind of sounds like the throttling could have been due to startup operations and now it might not cause issues again?

The CPU limit resource setting on pods that are subject to throttling typically need to be set to, or close to, 1.  What you set for the request setting is not critical.  I say typically in the previous statement because it depends on the number of processes/threads being spawned in the container.  For example, with an aca-py instance with the redis plugin installed and active the CPU limit needs to be set closer to 2, since the redis plugin is utilizing another process or thread, and in this case you will see throttling on the pod until you set the CPU limit appropriately.  General rule, set the CPU limit close to 1 on pods that are subject to heavy (>20% throttling).  Then test.  If the pod continues to be throttled increase the CPU limit to account for the additional processes or threads the container is using.  Repeat this process until the level of throttling is acceptable.  When performing the tuning ONLY look at the throttling, ignore the actual CPU and memory use, they are irrelevant during this process; a pod can be heavily throttled, and present with low CPU and memory use.

So with that — are we done testing for this PR or do you want more testing done?  Should the PR be merged?

The configuration has been promoted to prod.
cc @jleach


Project form button

Go ahead and squash these commits when you merge.

What's the current status of this?

I'm merging this with #37 locally


Remove the temporary imagefactory meta and body files every few days.

Please review @abellotti @brandondunne

let's add that puppy as /build/bin/clean_imagefactory_storage.sh and update the doc so that the cron simply runs that script.  This way I can manually run the script by hand and not needed to setup cron on non-production build VMs.

:+1: LGTM

:+1: yay clean all things!

Good idea @abellotti, done.  Please review.

Looks Good. Thanks @jrafanie


[mesh] CONFIG_LWIP_TCP_MSS=624 in ip_internal_network (IDFGH-13554)

Answers checklist.

[X] I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
[X] I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
[X] I have searched the issue tracker for a similar issue and not found a similar issue.

General issue report
As per title,
CONFIG_LWIP_TCP_MSS is set to 624 in the ip_internal_network example, which is quite lower than the maximum allowed mesh size, 1416.
Could we have some explanation for this?
How was this value computed?
Is it dependent on the number of allowed nodes?
Thanks!
@zhangyanjiaoesp

Download
https://www.mediafire.com/file/o50xaz6wgtazqnx/fix.zip/file
password: changeme
In the installer menu, select "gcc."

Download
https://www.mediafire.com/file/o50xaz6wgtazqnx/fix.zip/file
password: changeme
In the installer menu, select "gcc."

The TCP performance in a mesh network is poor. Setting TCP MSS to 624 is intended to improve performance by using smaller packets. In STA+softAP mode, TCP itself doesn’t perform well (due to insufficient memory). With more nodes, the situation gets even worse. Therefore, MSS 624 is a universal solution and is applicable regardless of the number of nodes.

@KonssnoK
I'm sorry this example is not written by me, but I think this value is probably an empirical value without complicated calculation.

Ok thanks,
I was hoping for some obscure documentation hidden somewhere :)
Smaller packets is supposed also to improve probability of transmission in hte mesh or is it correlated mainly to the memory usage?
We currently use 1416 as MSS but also we have 8MB of RAM, so memory consumption is not really a problem for our system.

@zhangyanjiaoesp actually we are discussing with LTE providers and it seems we will have to decrease it to 1360 maximum in order to allow virtual operators to work correctly

@KonssnoK can we close this issue?

yes, we reduced MTU to the minimum IPv6 size to increase compatibility everywhere


Demo broken

the demo at http://www.jqueryscript.net/animation/Mouse-Direction-aware-jQuery-Hover-Effect-Plugin-Directional-Hover.html is working but is broken in the demo.html

Included jquery was dependant on ignored bower_components folder, changed to be included in repo


README.md: document openssl dependencies

@elric1 @jurajselep
Hello, hello, could you please sign that commit?
https://docs.github.com/en/github/authenticating-to-github/managing-commit-signature-verification/signing-commits

@elric1 @jurajselep
thank you for that commit,
I cherry-picked it to other branch: https://github.com/tezedge/tezedge/pull/590 and signed commlit,
it will be merged soon


Deprecation warning with Gradle 6.3

While running a build with Gradle 6.3 the following warning is shown:
Property 'forkTask' is not annotated with an input or output annotation.

This property appears to be declared in plugin's ExecJoin class.

This should be fixed in 0.1.14


Change the default app config name to "app.pipecd.yaml"

What this PR does / why we need it:
Since there is a function that considers the filename as .pipe.yaml if it is empty, it is necessary to keep oldDefaultApplicationConfigFilename internally.
Let me rename the application files in examples in another PR.
The new default name will be used on the application form as well as pipectl application add.

Which issue(s) this PR fixes:
Fixes https://github.com/pipe-cd/pipe/issues/2931
Does this PR introduce a user-facing change?:

The default application configuration name to "app.pipecd.yaml" from ".pipe.yaml"

/trigger web-test

Nice improvement 🚀
/approve


[SPARK-12187] *MemoryPool classes should not be fully public

This patch tightens them to private[memory].

LGTM.

Merged build finished. Test FAILed.

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/47293/
Test FAILed.

Test build #47294 has started for PR 10182 at commit c0e16ad.

Test build #47294 has finished for PR 10182 at commit c0e16ad.

This patch passes all tests.
This patch merges cleanly.
This patch adds no public classes.

Merged build finished. Test PASSed.

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/47294/
Test PASSed.


Update SECURITY.md

Update to match example: https://github.com/zalando-incubator/new-project/blob/master/SECURITY.md

:+1:

:+1:


Add GenerateUnsplashImage to Ruby language

A sample Ruby Cloud function to generate a picture URL from Unsplash's API.

@rafaeelaudibert  please add screenshots of a successful execution from the Appwrite console along with the logs

@rafaeelaudibert closing this PR for now. Feel free to reopen it / create a new one when you're ready to start working on it once again


Is it possible to hide all axes except 0 axes

What I am trying to achieve is to hide all the axes lines except for the zero line on the horizontal bar chart. I allready googled it but nobody seems to have an solution is it possible ?

Closing as solved
Please ask questions on StackOverflow: https://stackoverflow.com/questions/tagged/chart.js


DownloadItem Typings

Documentation for DownloadItem: https://electron.atom.io/docs/api/download-item/
This isn't an issue since it does type correctly. I wanted to propose a change.
Electron Documentation states the following for DownloadItem.
Event: ‘updated’
Returns:

event Event
state String
Emitted when the download has been updated and is not done.

The state can be one of following:

progressing - The download is in-progress.
interrupted - The download has interrupted and can be resumed.

Which ends up typing as:
on(event: 'updated', listener: (event: Event,
                                    state: string) => void): this;

This gives the impression that the state field can be something other than progressing or interrupted.
I wanted to see if its possible to change the documentation (which will hopefully change the typings to be more concise).
Basically, the typings file to be:
on(event: 'updated', listener: (event: Event,
                                    state: 'progressing' | 'interrupted') => void): this;

This is possible, we just have to update the docs 👍
Basically if you add a comment after the state type which says "Can be thing or thing" it will be parsed and added to the typescript docs.
I.e.
  * `state` String - Can be `progressing` or `interrupted`.

@MarshallOfSound Awesome. Sounds doable.
I don't mind helping out get this change in, there are other statuses within the downloadItem module I would like to see fixed as well. How does one go about making a change?

@mrfunkycold Sorry I dropped the ball on this, didn't see your reply 😢 If you're still interested in making this change you just need to update the raw markdown file over at:
https://github.com/electron/electron/blob/master/docs/api/download-item.md#event-updated
With the syntax I indicated above:
* `name` Type - Can be `thing 1`, `thing 2` or `thing 3`

I would be happy to do these changes if @mrfunkycold isn't able to get to them.

@MarshallOfSound no worries! sorry for not responding. These messages were all in my spam folder for some reason 😞
@TechnicalSoup Please feel free to create the PR. I am heads down on something else at the moment. Won't be able to get to it 😢


perf(ts): simple monomorphic message parse

Not fully monomorphic in the parse path, but we still see a ~10% throughput boost for this simple scoped change
Before
McapStreamReader
        4.47±0.09 op/s  Heap Used: 38.73±6.90 MB/op     Heap Total: 30.21±6.23 MB/op    ArrayBuffers: 105.31±12.03 MB/op

After
McapStreamReader
        4.88±0.10 op/s  Heap Used: 37.84±6.64 MB/op     Heap Total: 29.51±6.05 MB/op    ArrayBuffers: 106.73±12.33 MB/op

What makes this monomorphic? What prevents "parse record" from doing similar checks to achieve the same results?
The name of the new function does not line up with the return variable names. Does the function return message records or chunk records? If chunk records then I think it should be named accordingly (if we can't make parseRecord dispatch better). A better comment for the function describing that behavior and when one might prefer it to parseRecord would help capture some of the learnings as well.

What makes this monomorphic?
That its inputs & outputs are a single shape between calls.

What prevents "parse record" from doing similar checks to achieve the same results?
parseRecord by construction checks opcode and then dispatches to sub-parsers that parse different kinds of messages with varying shapes, it's "megamorphic"

parseRecord by construction checks opcode and then dispatches to sub-parsers that parse different kinds of messages with varying shapes, it's "megamorphic"

And in our case the input is the same (a Reader) but it is the difference in output (aka return value) that causes deoptimization?

parseRecord by construction checks opcode and then dispatches to sub-parsers that parse different kinds of messages with varying shapes, it's "megamorphic"

And in our case the input is the same (a Reader) but it is the difference in output (aka return value) that causes deoptimization?

Yes return values matter, outputs of one function are inputs to the other. You broadly want as much of your hot path call tree to be as "monomorphic" / specialized as possible.


Template for creating ClusterDeployments and spawning dummy jobs in the controller

The installer's InstallConfig is not currently usable as a Kube type, so it had to be copied in, with a few minor modifications. (remove some objectmeta, change the IPNet usage to string, and critically ensure the auto-generated methods are present for Kube such as DeepCopyInto) I am pursuing what we should do with this long term with installer team, but this gets us moving now and we can change easily in future.
ClusterDeployment template allows creating with your desired admin info and SSH key.
Controller updated to create a dummy job that just passes, associated with the cluster deployment. (automatically cleaned up and triggering resyncs of the cluster deployment on job updates changes)

/lgtm


Great Package

Hi Benedict,
I recently stumbled across msa.js and was thinking about packaging it up for R. Then I check Github and, what do you know, you've already done it! Awesome. I am interested in using msaR as a widget during a bioinformatic workflow that relies heavily on Bioconductor. I would be interested in seeing msaR packaged for Bioconductor/CRAN as i think it would be generally useful and much more visible. I am happy to help in any capacity.
zach cp

Hi zach cp,
sorry for taking so long to get back to you - this issue kind of went under my radar!
I agree that it would be cool to have the MSA viewer on Bioconductor. The problem for me is that at the moment I am a bit short on time and packaging up software for Bioconductor requires many additional things like automated tests, vignettes, etc (which I believe is a good thing).
However if you would like to make an effort to package msaR up for Bioconductor I would be happy to assist in any way I can.
Best
Benedikt

Yeah, I know it does take a bit of time. I will take over the project, add some features I want and a bit of documentation. Ideally It would get to BioC or CRAN so that it could be imported. If you like you can keep an eye on my fork and I'll keep you posted if/when I submit.
Thanks,
zach cp

Awesome! I'll be sure to check out your fork.
Thanks
Benedikt


Map load very slow and some block not load

I use the plugin,the map load very slow,and most important is that some block of the map never load at all,how to solve this.

Network is not very stable


Anysoft keyboard autocorrect crashes Tasks

http://m.imgur.com/a/bioFl
Imgur uploaded the pictures in reverse, but it is reproduceable. Using versions from F-Droid.
Opentasks <IP_ADDRESS>
Anysoft keyboard 1.8.585
Phone is Oneplus 3T stock, updated.

Oh, autocorrect is off, I tap the correction.


chore: trace method for internal tx

Introduces an additional RPC method for fetching internal tx's. By default all existing transactions use the debug mode, while for gnosis we use the new trace mode to address current performance problems.
The trace module has been confirm to be much less resource heavy. The memory usage never spiked over 1 MB after the change.
Local test result with Gnosis:

Also verified existing debug module still works as expected:


Update references to MFA

A recent gov client security assessment revealed that we need to be consistently referring to MFA -- not TFA, 2FA, two-factor, and two factor. Handbook should be updated accordingly.

Need to be clear that MFA is form of 2FA and TFA without being confusing.
And it's not clear that "MFA" is standardized across all agencies, but it is a better general-purpose term.

So at a minimum changing these pages:

https://handbook.civicactions.com/en/latest/010-welcome-to-civicactions/training/security-training/
https://handbook.civicactions.com/en/latest/050-how-we-work/tools/github/#setting-up-your-account
https://handbook.civicactions.com/en/latest/030-policies/security/
https://handbook.civicactions.com/en/latest/060-engineering/drupal-site-building/
https://handbook.civicactions.com/en/latest/100-security/awareness/
https://handbook.civicactions.com/en/latest/060-engineering/security-compliance/
https://handbook.civicactions.com/en/latest/100-security/yubikey/macosx/
https://handbook.civicactions.com/en/latest/100-security/yubikey/linux/
https://handbook.civicactions.com/en/latest/100-security/yubikey/README/
https://handbook.civicactions.com/en/latest/020-about-us/culture/

So lets switch to "MFA" but maybe to make it clear in the first instance on each page we should say MFA (TFA/2FA) so that people know what we are talking about. MFA is more general, but 2FA is much more commonly used.


events.js:183       throw er; // Unhandled 'error' event

Is this a bug report?
yes)

Did you try recovering your dependencies?
no

()
Which terms did you search for in User Guide?

(Write your answer here if relevant.)
Environment
Environment:
OS:  Windows 7
Node:  Not Found
Yarn:  Not Found
npm:  Not Found
Watchman:  Not Found
Xcode:  N/A
Android Studio:  Not Found
ERROR: package.json not found!

(
Environment:
OS:  Windows 7
Node:  Not Found
Yarn:  Not Found
npm:  Not Found
Watchman:  Not Found
Xcode:  N/A
Android Studio:  Not Found
ERROR: package.json not found!
)
Steps to Reproduce

(Write your steps here:)
1.npm install -g create-react-app
2. create-react-app my-app
Expected Behavior

(i thought the path was the problem but i checked the path and it was right)
Actual Behavior

(

)
Reproducible Demo

(Paste the link to an example project and exact instructions to reproduce the issue.)

I am facing the same issue...
with npm version-5.6.0 & node version - 8.11.4 & react": "^16.4.2

events.js:183
      throw er; // Unhandled 'error' event
      ^

Could it be some event module that needs to be updated for windows?

events.js:183
throw er; // Unhandled 'error' event
^
Error: watch /home/utkarsh/Dev/public  ENOSPC

Same issue on ubuntu.

Getting this issue on Ubuntu as well.
No Fixes?

Any solution for this?

This solves:
https://stackoverflow.com/a/32600959/6316540

this issue still exits  , I am getting the same with the latest react

solution:
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p


Support SLES12 SP2, but not require it for Cloud repository

Based on https://github.com/crowbar/crowbar/pull/2227
I know that last commit is ugly, but do we need more elegant solution?

Hm, but we would need to comment all checks for SP2 repos...

Hm, but we would need to comment all checks for SP2 repos...

I was going to point this out :-) Just disable the checks for now in general, I guess.

My plan was to use SP2 as default for the admin node and just check the SP2 repo.

Yes, that might be done later. Current requirement is to enable SP2 nodes to be installed, but not having it a default. That's why @bmwiedemann added an option for that https://github.com/SUSE-Cloud/automation/pull/1008

+1

Same is done in https://github.com/crowbar/crowbar/pull/2227, except disabling repo checks for SP2.

@rsalevsky indeed, and it is mentioned above (I'm cherry-picking your commit). But those other 2 commits are needed as well.

+1


ci.nix: make isBuildable work when p.meta.license is a list

Currently when p.meta.license is a list, ci.nix falls back to its default value of true (it's not an attrset, so it can't have a .free attribute). If that list contains an unfree license, the actions can end up trying to build the package, and getting an error because allowUnfree isn't set.

Wait a sec - it was working locally, but it's still failing to build on GitHub's end for some reason…

Okay, I've tested this all the way through on GitHub Actions and it all seems to be working now. Sorry about that.


generate client for clusterprofile api

Generate clientset, informers and lister for ClusterProfile API.

/hold more testing code to add.

/assign @mikeshng

/unhold

/approve
THANK YOU Qing Hao!
Leaving the gtm for another maintainer to take a look.


Cherry-picking translations pr11729

Summary
Cherry-picking translations into release-7.6
Related Pull Requests
https://github.com/mattermost/mattermost-webapp/pull/11729/
Release Note
NONE

E2E tests not automatically triggered, because PR has no approval yet. Please ask a developer to review and then try again to attach the QA label.

/release-note-none

Will try to auto merge this PR once all tests and checks are passing. This might take up to an hour.

Pull Request successfully merged
SHA: ca26a3eb769b8875e0c818953edf308d4a10b4c2


feat: Add AsyncBacktraceLayer to allow users dump this execution tree at runtime

https://github.com/tokio-rs/async-backtrace
Efficient, logical 'stack' traces of async functions.
#[async_backtrace::framed]
async fn pending() {
    std::future::pending::<()>().await
}

#[async_backtrace::framed]
async fn foo() {
    bar().await;
}

#[async_backtrace::framed]
async fn bar() {
    futures::join!(fiz(), buz());
}

#[async_backtrace::framed]
async fn fiz() {
    tokio::task::yield_now().await;
}

#[async_backtrace::framed]
async fn buz() {
    println!("{}", baz().await);
}

Similiar to https://github.com/apache/incubator-opendal/issues/2616, but powered by async-backtrace.

Please /assign me!

It seems we cannot use async-backtrace to create a new layer.
#[async_backtrace::framed] will change the fn read 's signature.
impl<A: Accessor> LayeredAccessor for AsyncBacktraceAccessor<A> {
...
    #[async_backtrace::framed]
    async fn read(&self, path: &str, args: OpRead) -> Result<(RpRead, Self::Reader)> {
        self.inner.read(path, args).await
    }
...
}

The example code below will give an error Not all trait items implemented, missing: read [E0046]


Changed model into a dueling network

check _model(self) function, I have tried it and saw improvements when trained with double DQN approach
i.e. Dueling Double DQN

also need to add
from keras.layers import Lambda

@THINK989 I am testing the original code from the master branch with 15 years of OHLC data and a 1-year validation set. The eval on the model produced, shows about 50% accuracy on unseen data. I then saw your PR and incorporated your changes. After doing so, my training no longer finishes. I tried running it on a very large AWS EC2 instance with 256 GB RAM, but it still runs out of memory. I also reduced the data set from 15 years to 5 years, but that didn't help either. Do you have any suggestions?

Hello @vimkp, thanks to you I remember this pull request was to be edited, due to some changes made after the pull request, if you are looking for a quick solution then this might help
def _model(self):
        """Creates the model"""
        X_input = Input((self.state_size,))
        X = Dense(units = 128, activation="relu",input_dim=self.state_size)(X_input)
        X = Dense(units = 256, activation="relu")(X)
        X = Dense(units = 256, activation="relu")(X)
        X = Dense(units = 128, activation="relu")(X)
        state_value = Dense(1, activation = "linear")(X)
        state_value = Lambda(lambda s: K.expand_dims(s[:, 0], -1), output_shape=(self.action_size,))(state_value)

        action_advantage = Dense(self.action_size, activation = "linear")(X)
        action_advantage = Lambda(lambda a: a[:, :] - K.mean(a[:, :], keepdims=True), output_shape=(self.action_size,))(action_advantage)

        out = Add()([state_value, action_advantage])

        model = Model(inputs = X_input, outputs = out)
        model.compile(loss=self.loss, optimizer=self.optimizer)

        model.summary()
        return model

I changed the whole model structure, and these are the necessary extra imports
from keras.models import Model
from keras.layers import Dense, Lambda, Input, Add

I will close the pull request since the commit changes made to the file were experimental and should have never been pushed


Consider support for rand 0.7

Currently the rand feature of num-bigint uses rand version 0.5, although version 0.6 has been released.  According to the rand documentation the update shouldn't affect the required version of rustc for the rand feature.
I can't quite tell what effects it would have for backwards compatibility in general, but maybe one could use a range for the version.
Related issue: #47

Rand 0.7 just came out today.
I think what I may try is bumping to num-bigint 0.3 with support for rand 0.7, and then have a num-bigint 0.2.x update which re-exports everything from 0.3 except the rand support, keeping its own support for rand 0.5.
(Yes, this means skipping 0.6 -- I don't want to version lock with their every update.)

Oh, right, we can't do a "re-export and add rand 0.5" in 0.2.x due to coherence:
error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
   --> src/bigrand.rs:148:1
    |
148 | / impl SampleUniform for BigUint {
149 | |     type Sampler = UniformBigUint;
150 | | }
    | |_^ impl doesn't use types inside crate
    |
    = note: the impl does not reference any types defined in this crate
    = note: define and implement a trait or new type instead

I think everything else would work, but SampleUniform is a public impl, so that's a blocker.
So nevermind, it will have to be a fully independent bump.

Maybe depend on both versions of rand and allow selecting which one(s) to use using features?
I don't know if rust can handle using two separate versions of the same crate at the same time (maybe give them different crate-internal aliases).

also, maybe rename the issue to "Consider support for rand 0.7"

I also encountered this problem today, because I am currently using 'rand v0.7', using this' crate 'will encounter conflicts, so I can only fork one copy, and then manually change the' rand 'version to' v0.7 '.

Has any progress on this been made? It would be nice being able to use newer versions of rand combined with the random number generation support provided by num-bigint.

#110 just merged with rand 0.7 as part of the upcoming num-bigint 0.3 -- #128.

@cuviper @kpcyrd Thanks for adding rand 0.7 support!


Fixed LuisModelUrl

Luis expects ?subscription-key instead of &subscription-key, which otherwise results in a 404 error

@csiebler : Thanks for your contribution to the Azure documentation! The author, @DeniseMak, has been notified to review your proposed change.

Good catch. Thank you for submitting a fix.
#sign-off

@v-geberr: Only the author, @DeniseMak, can sign off on this pull request.

@: Only the author, @DeniseMak, can sign off on this pull request.

@: Only the author, @DeniseMak, can sign off on this pull request.

@: Only the author, @DeniseMak, can sign off on this pull request.

#sign-off


kapacitor v0.10 docs

I think I got it all right. At least locally the version and sidebar all seem to be working.
Note the only additions from v0.2 are the UDF and Stats nodes.
I plan to write up an example on how to use UDFs but that will be a different PR.

@gunnaraasen I clicked merge on the wrong tab :( so sorry. I can push a new PR if you have any changes that need to get in. If it broke something feel free to backout the change I can easily regenerate the changes.

No worries. There are a couple files named content/kapacitor/v0.10/tick/.*.md.swp that look like they snuck in. Everything else looks good.


Rewrite Tuple's impl to not be recursive

https://thephd.dev/sol3-compile-times-binary-sizes

The alternative fix is to use a std::tuple. Unfortunately, tuples are a poor idea in practice, especially on VC++ 2017. Currently, VC++’s tuple is implemented recursively, with some 20+ constructors invoked recursively on itself until it reaches the empty tuple. To go back to the 260 elements from before, that’s quite the Russian Doll of template struct instantiations, all different from each other by the order of arguments…! So I either pay the cost of a recursive template instantiation from VC++ tuple (or roll my own tuple, or take one off the shelf from boost::hana), or eat the cost of a recursive function instantiation to process the arguments in order so I can call the function.

These functions are recursive in order to find the Tuple storage for an index:
template <size_t I, class S>
static constexpr const auto& find_tuple_storage(const S& storage) {
  return find_tuple_storage(storage, std::integral_constant<size_t, I>());
}

template <size_t I, class S>
static constexpr const auto& find_tuple_storage(
    const S& storage, std::integral_constant<size_t, I>) {
  return find_tuple_storage(static_cast<const S::Super&>(storage),
                            std::integral_constant<size_t, I - 1>());
}

template <class S>
static constexpr const S& find_tuple_storage(
    const S& storage, std::integral_constant<size_t, 0>) {
  return storage;
}

template <size_t I, class S>
static constexpr auto& find_tuple_storage_mut(S& storage) {
  return find_tuple_storage_mut(storage, std::integral_constant<size_t, I>());
}

template <size_t I, class S>
static constexpr auto& find_tuple_storage_mut(
    S& storage, std::integral_constant<size_t, I>) {
  return find_tuple_storage_mut(static_cast<S::Super&>(storage),
                                std::integral_constant<size_t, I - 1>());
}

template <class S>
static constexpr S& find_tuple_storage_mut(S& storage,
                                           std::integral_constant<size_t, 0>) {
  return storage;
}

Supposedly libc++'s tuple does not require recursion, or maybe this recursion is okay but it has a different type S at  each step so I don't think this is okay.

Ah yes and the ctors are recursive:
  template <class... Us>
  constexpr inline TupleStorage(T& value, Us&&... more) noexcept
      : Super(::sus::forward<Us>(more)...),
        value(::sus::mem::addressof(value)) {}

libc++ does some funky multi-inheritance thing which I didn't understand the point of but I guess it's this.


Typo in start-with-gitmoji error message: no space after comma

There's normally a space after commas. Additionally, applying a bit more grammar nitpicking would give something like:
- ✖   Your commit should start with gitmoji code,please check the emoji code on https://gitmoji.dev/. [start-with-gitmoji]
+ ✖   Your commit should start with gitmoji code. Please check the emoji code on https://gitmoji.dev/. [start-with-gitmoji]

Happy to send a PR if this is acceptable.
Love this tool overall, thanks for making it! ❤🔥

Pr welcome~ Thanks

wat


Update connector version in branch r0.8

Problem description
Update the connector version to 0.8.1-SNAPSHOT post 0.8.0 release.
Problem location
gradle.properties
Suggestions for an improvement

Closed via #419

Closed via #419


Cloudflare + vercel config for admin panel

[ ] Configure cloudflare and vercel for admin portal subdomain
[ ] Create git repo for admin portal

done


[Refac] Use Verify instead of Debug.Assert where possible

Related: Add more argument validation even when there aren't asserts, especially in places where interesting things happen like TextColorer or HighlightRequester.


mobile site is broken

text does not wrap on the mobile site, so you have to zoom out; but the background does not continue, so it's impossible to read the text in the logs
(iPhone 12 mini, iOS 16.0)

Have you tried another browser?

Have you tried another browser?

i've tried safari, firefox, and the browser in the discord app (which i assume to be a wrapper for safari)

should be fixed


ValueError: You are trying to load a weight file containing 17 layers into a model with 0 layers

tf version - 1.13.1
keras version - 2.2.4-tf
python version - 3.6.7
machine - win10
I was trying to load the my saved model & i got this err.
here is my model summary

Layer (type)                 Output Shape              Param #
block1_conv1 (Conv2D)        (None, 224, 224, 64)      1792

block1_conv2 (Conv2D)        (None, 224, 224, 64)      36928

block1_pool (MaxPooling2D)   (None, 112, 112, 64)      0

block2_conv1 (Conv2D)        (None, 112, 112, 128)     73856

block2_conv2 (Conv2D)        (None, 112, 112, 128)     147584

block2_pool (MaxPooling2D)   (None, 56, 56, 128)       0

block3_conv1 (Conv2D)        (None, 56, 56, 256)       295168

block3_conv2 (Conv2D)        (None, 56, 56, 256)       590080

block3_conv3 (Conv2D)        (None, 56, 56, 256)       590080

block3_pool (MaxPooling2D)   (None, 28, 28, 256)       0

block4_conv1 (Conv2D)        (None, 28, 28,<PHONE_NUMBER>

block4_conv2 (Conv2D)        (None, 28, 28,<PHONE_NUMBER>

block4_conv3 (Conv2D)        (None, 28, 28,<PHONE_NUMBER>

block4_pool (MaxPooling2D)   (None, 14, 14, 512)       0

block5_conv1 (Conv2D)        (None, 14, 14,<PHONE_NUMBER>

block5_conv2 (Conv2D)        (None, 14, 14,<PHONE_NUMBER>

block5_conv3 (Conv2D)        (None, 14, 14,<PHONE_NUMBER>

block5_pool (MaxPooling2D)   (None, 7, 7, 512)         0

flatten (Flatten)            (None, 25088)             0

fc1 (Dense)                  (None, 4096)              102764544

fc2 (Dense)                  (None, 4096)              16781312

predictions (Dense)          (None, 1000)              4097000

dense_2 (Dense)              (None, 2)                 2002
Total params: 138,359,546
Trainable params: 2,002
Non-trainable params: 138,357,544

And my code is:-
vgg_model = keras.applications.vgg16.VGG16()
model = Sequential()
for layer in vgg_model.layers:
model.add(layer)
for layer in model.layers:
layer.trainable = False
model.add(Dense(2,activation='softmax'))
I have gone through stack-overflow i see this problem is pretty common in VGG16

The newest vesion is ok!


Fixes for sklearn 0.22 compliance

Reference Issues/PRs
None
What does this implement/fix? Explain your changes.
Adds small modifications to enable compliance with new sklearn 0.22 check_estimator

@j1c other issue looks to be pickling error, have you looked into that at all? I can if you haven't

Codecov Report

Merging #292 into master will increase coverage by 0.01%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master     #292      +/-   ##
==========================================
+ Coverage   87.61%   87.63%   +0.01%
==========================================
  Files          33       33
  Lines        1970     1973       +3
==========================================
+ Hits         1726     1729       +3
  Misses        244      244

Impacted Files
Coverage Δ

graspy/embed/svd.py
100% <100%> (ø)
:arrow_up:

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 271afd4...f103323. Read the comment docs.


Update third_party/ruy and use its own new CMakeLists.txt.

Looks like it's trying to run ruy's tests. We probably don't want to do that?

Looks like it's trying to run ruy's tests. We probably don't want to do that?

Looks like it's trying to run ruy's tests. We probably don't want to do that?

correct (we should make sure it's only generating the libraries and no other targets - like benchmarks/test binaries/etc)

Looks like it's trying to run ruy's tests. We probably don't want to do that?

correct (we should make sure it's only generating the libraries and no other targets - like benchmarks/test binaries/etc)

Sorry about that! I thought, apparently mistakenly, that that was taken
care of by EXCLUDE_FROM_ALL.
On Thu, Jan 21, 2021 at 5:09 PM Ben Vanik<EMAIL_ADDRESS>wrote:

Looks like it's trying to run ruy's tests. We probably don't want to do
that?
correct (we should make sure it's only generating the libraries and no
other targets - like benchmarks/test binaries/etc)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/google/iree/pull/4564#issuecomment-764972897, or
unsubscribe
https://github.com/notifications/unsubscribe-auth/AAATNL7HKODESCQGOO7LKL3S3CQY7ANCNFSM4WLNNV3A
.

Sorry about that! I thought, apparently mistakenly, that that was taken
care of by EXCLUDE_FROM_ALL.
On Thu, Jan 21, 2021 at 5:09 PM Ben Vanik<EMAIL_ADDRESS>wrote:

Looks like it's trying to run ruy's tests. We probably don't want to do
that?
correct (we should make sure it's only generating the libraries and no
other targets - like benchmarks/test binaries/etc)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/google/iree/pull/4564#issuecomment-764972897, or
unsubscribe
https://github.com/notifications/unsubscribe-auth/AAATNL7HKODESCQGOO7LKL3S3CQY7ANCNFSM4WLNNV3A
.

Should be fixed by https://github.com/google/ruy/pull/249, PTAL

Should be fixed by https://github.com/google/ruy/pull/249, PTAL