Use ui-router instead of content-for

So I just read that you have a content-for directive as a form of transcluding scope to other parts of the screen. Have you looked at doing this via ui-router using resolves and named views? It lets you spit out viewports anywhere in the view layer despite state level, and all of those named view controllers share the same resolves. Which means instead of having to put scope everywhere you're just giving access to shared resolves.

Hi @ProLoser,
many people prefer ui-router, but although new docs will have a section about how to integrate ui-router (there is no conflict with maui), i'm not sure to make it default, i prefer to leave the decision to users.
Anyway can u explain a little more, maybe with an example?


52 | N-Queens II | Java

Title - 52 | N-Queens II | Java
What will change - Adding solution to problem 52
Type of Issue -
Please add/delete options that are not relevant.

[x] Adding New Code
[ ] Improving Code
[ ] Improving Documentation
[ ] Bug Fix

Programming Language
Please add/delete options that are not relevant.

[ ] Python
[ ] C++
[x] Java
[ ] SQL

Self Check

Ask for issue assignment and wait to get assigned to it before making Pull Request.
Add your file in the proper folder
Clean Code and Documentation for better readability
Add Title and Description of the program in the file

:star2: Star it :fork_and_knife:Fork it :handshake: Contribute to it!
Discord server ✉ - https://discord.gg/CXksGdn
Happy Coding,

Please assign this issue to me

Please assign this to me for Python.

Hi @ChetanaL09
It's good to see that you want to contribute but read the contributing.md file first
you should open your own issues and then ask for assign
This issue is already assigned to me and i have already opened pull request.


Put client_max_body_size in server config if found in ingress annotation

@moserke please check this https://github.com/kubernetes/contrib/pull/280
The idea is to allow the customization of the configuration without the use of annotations.

@moserke thanks for the pr. WDYT about just doing https://github.com/kubernetes/contrib/pull/280? feel free to review that one and put in feature requests. If you'd really like just this one feature in the nginx-toy I'm fine with that as well (though I doubt that's the case?)

This was actually inadvertently opened.  Meant to PR onto our forked master branch.    Not ready for wide prime time.  :-)

@moserke well, comments on https://github.com/kubernetes/contrib/pull/280 are still much appreciated. Especially if you can shoehorn your use cases in there.


OpenEdu API directory has been changed

The API directory and structure of OpenEdu API has been changed, scraper cannot run normally, to be fixed.

@Open-Edu-Tw/scraper-team


Possible Issue with Internal Representation of Function Types

Initial Checks

[X] I confirm that I'm using Pydantic V2

Description
In pydantic-settings, the CliSettingsSource implementation for generating metavar strings is based off of pydantic display_as_type. An issue was found where some builtin functions can fail to get categorized as functions when using isinstance(obj, FunctionType). Specifically, in pydantic this line here.
This can be fixed using the inspect module as shown in the example.
Additionally, the string representation for function types can be made a little more pretty by only using obj.__name__ for local functions, and obj.__qualname__ otherwise.
Example Code
from pydantic import BaseModel
from typing import Any, Callable
from types import FunctionType

import inspect
import time

# Current Issue
print(isinstance(time.time_ns, FunctionType))
# > False

# Suggested Fix
def is_function(obj: Any) -> bool:
    return inspect.isfunction(obj) or inspect.isbuiltin(obj) or inspect.isroutine(obj) or inspect.ismethod(obj)

print(is_function(time.time_ns))
# > True

# Prettier Function Representation
class Dummy(BaseModel):
    def foo(self) -> None: ...

    @staticmethod
    def local_bar() -> Callable[[], None]:
        def bar() -> None: ...
        return bar

def current_function_repr(obj: Any) -> str:
    return obj.__name__

def prettier_function_repr(obj: Any) -> str:
    # If function is locally defined use __name__ instead of __qualname__
    return obj.__name__ if '<locals>' in obj.__qualname__ else obj.__qualname__

print(current_function_repr(Dummy.foo))
# > foo
print(prettier_function_repr(Dummy.foo))
# > Dummy.foo
print(current_function_repr(Dummy.local_bar()))
# > bar
print(prettier_function_repr(Dummy.local_bar()))
# > bar

Python, Pydantic & OS Version
❯ python -c "import pydantic.version; print(pydantic.version.version_info())"
             pydantic version: 2.7.4
        pydantic-core version: 2.18.4
          pydantic-core build: profile=release pgo=true
                 install path: /home/kschwab/.local/lib/python3.12/site-packages/pydantic
               python version: 3.12.4 (main, Jun  7 2024, 00:00:00) [GCC 14.1.1 20240607 (Red Hat 14.1.1-5)]
                     platform: Linux-6.10.6-200.fc40.x86_64-x86_64-with-glibc2.39
             related packages: email-validator-2.1.0.post1 pydantic-settings-2.3.1 pyright-1.1.372 typing_extensions-4.12.2 mypy-1.10.0
                       commit: unknown

@kschwab,
Thanks for reporting this. Happy to consider a PR with a fix. My guess here is that the main concern is performance, but if the behavior is more correct, we could compromise.
Please include tests showcasing the new behavior, as well as an added benchmark that we can use to compare the performance before and after this change!

Maybe using types.BuiltinFunctionType and/or other related types defined there could help?
https://docs.python.org/3/library/types.html#types.BuiltinFunctionType
In [1]: from types import BuiltinFunctionType, FunctionType
In [2]: import time
In [3]: isinstance(time.time_ns, (BuiltinFunctionType, FunctionType))
Out[3]: True
In [4]: time.time_ns.__name__
Out[4]: 'time_ns'
In [5]: isinstance(len, (BuiltinFunctionType, FunctionType))
Out[5]: True
In [6]: def fx(a, b): return a + b
In [7]: isinstance(fx, (BuiltinFunctionType, FunctionType))
Out[7]: True
In [8]: from functools import partial
In [9]: f1 = partial(fx, 1)
In [10]: isinstance(f1, (BuiltinFunctionType, FunctionType))
Out[10]: False
In [11]: f1.__name__
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[11], line 1
----> 1 f1.__name__

AttributeError: 'functools.partial' object has no attribute '__name__'

@mpkocher that's a cleaner fix 👍🏾
I probably won't get to this until sometime next week. Feel free to throw something up sooner if you get the time.

@sydney-runkle, I limited the fix to only identifying builtin function types as suggested by @mpkocher.
With respect to benchmarks, I'm not sure where this function gets called in the natural flow. Do you believe it is still necessary with the reduced scope? Fix is here.