Generating C helper code using Jinja2 and python

hey @kayhayen, I implemented this code and it is working fine yet there are some problems with jinja2 and I am trying to figure that out like there are no global variables in jinja2 which is creating a problem to pass values from jinja2 to python.
one of the solution that i got is creation of dictionary as it always points to its address so no ambiguity is caused but it is also creating a little problem. If you know any relevant solution please do guide me.
What does this PR do?
This PR add two given numbers with the help of jinja2. This code is a combination of python and jinja2.
Why was it initiated? Any relevant Issues?
#283
PR Checklist

[ ] Adding global variable(this can solve almost every problem)

I am not sure, what this shows really. Using rendered templates in rendering templates is very unlikely to be useful to us, it it?
I would much prefer also if you aimed at the C code that we described in the trial we made.

@kayhayen if you find this Python code more powerful and readable than I will go with this rather than pure jinja2 code.
I am aiming for that C code and with the help of that C code only I was ale to develop this python code.

@kayhayen are you asking me to use the C code with Python the way it is used in this code https://github.com/iovisor/bcc/blob/12bd958186a8c3bfcf2f74d246b8c06dd20bbc20/tests/python/test_clang.py#L52 ?

@riya-17 That is not using Jinja, is it? In fact I didn't see any templating there?
I am surprised, you didn't continue on this kind of code, that we mocked up:
import jinja2

int_details = {
    "type_name" : "int"
}
float_details = {
    "type_name" : "float"
}
object_details = {
    "type_name" : "object"
}

def toHelperName(type_name):
    return type_name.upper()

def isInt(type_name, operand):
    if type_name == "int":
        return "1"
    elif type_name == "object":
        return "PyInt_Check(%s)" % operand
    else:
        return "0"

add_template_str = r"""
PyObject *BINARY_OPERATION_ADD_{{toHelperName(left.type_name)}}_{{toHelperName(right.type_name)}}(PyObject *operand1, PyObject *operand2) {
    CHECK_OBJECT(operand1);
    CHECK_OBJECT(operand2);

#if PYTHON_VERSION < 300
    // Something similar for Python3 should exist too.
    if ({{isInt(left.type_name, "operand1")}} && {{isInt(right.type_name, "operand2")}}) {
        long a, b, i;

        a = PyInt_AS_LONG(operand1);
        b = PyInt_AS_LONG(operand2);

        i = a + b;

        // Detect overflow, in which case, a "long" object would have to be
        // created, which we won't handle here.
        if (likely(!((i ^ a) < 0 && (i ^ b) < 0))) {
            return PyInt_FromLong(i);
        }
    }
#endif

    binaryfunc slot1 = NULL;
    binaryfunc slot2 = NULL;

    PyTypeObject *type1 = Py_TYPE(operand1);
    PyTypeObject *type2 = Py_TYPE(operand2);

    if (type1->tp_as_number != NULL && NEW_STYLE_NUMBER(operand1)) {
        slot1 = type1->tp_as_number->nb_add;
    }

    if (type1 != type2) {
        if (type2->tp_as_number != NULL && NEW_STYLE_NUMBER(operand2)) {
            slot2 = type2->tp_as_number->nb_add;

            if (slot1 == slot2) {
                slot2 = NULL;
            }
        }
    }

    if (slot1 != NULL) {
        if (slot2 && PyType_IsSubtype(type2, type1)) {
            PyObject *x = slot2(operand1, operand2);

            if (x != Py_NotImplemented) {
                if (unlikely(x == NULL)) {
                    return NULL;
                }

                return x;
            }

            Py_DECREF(x);
            slot2 = NULL;
        }

        PyObject *x = slot1(operand1, operand2);

        if (x != Py_NotImplemented) {
            if (unlikely(x == NULL)) {
                return NULL;
            }

            return x;
        }

        Py_DECREF(x);
    }

    if (slot2 != NULL) {
        PyObject *x = slot2(operand1, operand2);

        if (x != Py_NotImplemented) {
            if (unlikely(x == NULL)) {
                return NULL;
            }

            return x;
        }

        Py_DECREF(x);
    }

#if PYTHON_VERSION < 300
    if (!NEW_STYLE_NUMBER(operand1) || !NEW_STYLE_NUMBER(operand2)) {
        int err = PyNumber_CoerceEx(&operand1, &operand2);

        if (unlikely(err < 0)) {
            return NULL;
        }

        if (err == 0) {
            PyNumberMethods *mv = Py_TYPE(operand1)->tp_as_number;

            if (mv) {
                binaryfunc slot = mv->nb_add;

                if (slot != NULL) {
                    PyObject *x = slot(operand1, operand2);

                    Py_DECREF(operand1);
                    Py_DECREF(operand2);

                    if (unlikely(x == NULL)) {
                        return NULL;
                    }

                    return x;
                }
            }

            // CoerceEx did that
            Py_DECREF(operand1);
            Py_DECREF(operand2);
        }
    }
#endif

    // Special case for "+", also works as sequence concat.
    PySequenceMethods *seq_methods = Py_TYPE(operand1)->tp_as_sequence;

    if (seq_methods && seq_methods->sq_concat) {
        PyObject *result = (*seq_methods->sq_concat)(operand1, operand2);

        if (unlikely(result == NULL)) {
            return NULL;
        }

        return result;
    }

    PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for +: '%s' and '%s'", type1->tp_name, type2->tp_name);

    return NULL;
}
"""

add_template = jinja2.Template(add_template_str)

types = (int_details, float_details, object_details)

for left in types:
    for right in types:
        print(add_template.render(left=left, right=right,
                                  # TODO: Move thoses ones to environment "env"
                                  toHelperName=toHelperName, isInt=isInt))

In my mind, the TODO item about env is crap, those free functions should simply be methods of the type descriptions, that most probably should simply be objects, and then you call left.isInt() and go from there.

Your examples have the disadvantage of using Python code to generate Python code with Jinja2 code, and thus making it very unclear what is what, and being far from the problem that #283 is about.

If you mean to explore macros, or if statements, etc. I would rather see it applied to this kind of code, because it makes it clear, why it's useful.
I personally think that there may come a point where e.g. macros could be useful. But much like what I said previously, right now I would be hard pressed to understand why. Maybe when you leave ADD_* as a completed thing and find that MUL_* shares things that are best expressed that way.
I re-new my recommendation to first get something working, then to search for missing features of Jinja2 that we are not using. There is absolutely no problem to re-factor later. And I am highly dubious that different operations will have very much to share.

@riya-17 That is not using Jinja, is it? In fact I didn't see any templating there?
I am surprised, you didn't continue on this kind of code, that we mocked up:
import jinja2

int_details = {
    "type_name" : "int"
}
float_details = {
    "type_name" : "float"
}
object_details = {
    "type_name" : "object"
}

def toHelperName(type_name):
    return type_name.upper()

def isInt(type_name, operand):
    if type_name == "int":
        return "1"
    elif type_name == "object":
        return "PyInt_Check(%s)" % operand
    else:
        return "0"

add_template_str = r"""
PyObject *BINARY_OPERATION_ADD_{{toHelperName(left.type_name)}}_{{toHelperName(right.type_name)}}(PyObject *operand1, PyObject *operand2) {
    CHECK_OBJECT(operand1);
    CHECK_OBJECT(operand2);

#if PYTHON_VERSION < 300
    // Something similar for Python3 should exist too.
    if ({{isInt(left.type_name, "operand1")}} && {{isInt(right.type_name, "operand2")}}) {
        long a, b, i;

        a = PyInt_AS_LONG(operand1);
        b = PyInt_AS_LONG(operand2);

        i = a + b;

        // Detect overflow, in which case, a "long" object would have to be
        // created, which we won't handle here.
        if (likely(!((i ^ a) < 0 && (i ^ b) < 0))) {
            return PyInt_FromLong(i);
        }
    }
#endif

    binaryfunc slot1 = NULL;
    binaryfunc slot2 = NULL;

    PyTypeObject *type1 = Py_TYPE(operand1);
    PyTypeObject *type2 = Py_TYPE(operand2);

    if (type1->tp_as_number != NULL && NEW_STYLE_NUMBER(operand1)) {
        slot1 = type1->tp_as_number->nb_add;
    }

    if (type1 != type2) {
        if (type2->tp_as_number != NULL && NEW_STYLE_NUMBER(operand2)) {
            slot2 = type2->tp_as_number->nb_add;

            if (slot1 == slot2) {
                slot2 = NULL;
            }
        }
    }

    if (slot1 != NULL) {
        if (slot2 && PyType_IsSubtype(type2, type1)) {
            PyObject *x = slot2(operand1, operand2);

            if (x != Py_NotImplemented) {
                if (unlikely(x == NULL)) {
                    return NULL;
                }

                return x;
            }

            Py_DECREF(x);
            slot2 = NULL;
        }

        PyObject *x = slot1(operand1, operand2);

        if (x != Py_NotImplemented) {
            if (unlikely(x == NULL)) {
                return NULL;
            }

            return x;
        }

        Py_DECREF(x);
    }

    if (slot2 != NULL) {
        PyObject *x = slot2(operand1, operand2);

        if (x != Py_NotImplemented) {
            if (unlikely(x == NULL)) {
                return NULL;
            }

            return x;
        }

        Py_DECREF(x);
    }

#if PYTHON_VERSION < 300
    if (!NEW_STYLE_NUMBER(operand1) || !NEW_STYLE_NUMBER(operand2)) {
        int err = PyNumber_CoerceEx(&operand1, &operand2);

        if (unlikely(err < 0)) {
            return NULL;
        }

        if (err == 0) {
            PyNumberMethods *mv = Py_TYPE(operand1)->tp_as_number;

            if (mv) {
                binaryfunc slot = mv->nb_add;

                if (slot != NULL) {
                    PyObject *x = slot(operand1, operand2);

                    Py_DECREF(operand1);
                    Py_DECREF(operand2);

                    if (unlikely(x == NULL)) {
                        return NULL;
                    }

                    return x;
                }
            }

            // CoerceEx did that
            Py_DECREF(operand1);
            Py_DECREF(operand2);
        }
    }
#endif

    // Special case for "+", also works as sequence concat.
    PySequenceMethods *seq_methods = Py_TYPE(operand1)->tp_as_sequence;

    if (seq_methods && seq_methods->sq_concat) {
        PyObject *result = (*seq_methods->sq_concat)(operand1, operand2);

        if (unlikely(result == NULL)) {
            return NULL;
        }

        return result;
    }

    PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for +: '%s' and '%s'", type1->tp_name, type2->tp_name);

    return NULL;
}
"""

add_template = jinja2.Template(add_template_str)

types = (int_details, float_details, object_details)

for left in types:
    for right in types:
        print(add_template.render(left=left, right=right,
                                  # TODO: Move thoses ones to environment "env"
                                  toHelperName=toHelperName, isInt=isInt))

In my mind, the TODO item about env is crap, those free functions should simply be methods of the type descriptions, that most probably should simply be objects, and then you call left.isInt() and go from there.

@kayhayen Sorry, I got confused regarding the implementation of the code. The approach that I thought I have to follow is to implement this C code exactly using Jinja2 and Python.
Now what I understand is that I have to develop a code using jinja which generates specialized code. The specialized code that I understood is the one which have different and exact functions for each functionality.
Example:
if I have concat two strings than there must be a different and direct function for that .
if I have to add two integers than a function have to be developed which can add values according to data types as we have tried to implement above with int, float and object and various combination of them like int, float or int, long, etc.
If there are comparison operations, <, <=, ==, !=, >=, >, than there should be a function specialised for them with Int data type only as they are only in INT`
Sorry for this misunderstanding this time I would like to ask you to verify whether the outline that I am building Is right or wrong and please correct me?

@riya-17 Exactly, big relief on my side. :)
When you say "two strings", it means two "PyObject *" known to be strings, e.g. PyString_Check() is true for them.
Exactly true, you are supposed to generate code for all possible combinations, or least the important ones. We ought to blacklist the ones that optimization will not allow because they statically raise, e.g. a float object and a list object do not work for "+", they might for "*".
Comparison operations should also be generated for all kinds of combinations and for each of the operators. Currently they exist as manual version for "INT" (Python2 int) only, but that doesn't mean, we do not want them for FLOAT, etc.
It feels as if you re-read the underlying issue, but at least now I understand better what your PRs were aiming at.

@kayhayen yaa, I kind of understood that something is not going right so re-read them and just cleared with you.

@riya-17 That is not using Jinja, is it? In fact I didn't see any templating there?
I am surprised, you didn't continue on this kind of code, that we mocked up:
import jinja2

int_details = {
    "type_name" : "int"
}
float_details = {
    "type_name" : "float"
}
object_details = {
    "type_name" : "object"
}

def toHelperName(type_name):
    return type_name.upper()

def isInt(type_name, operand):
    if type_name == "int":
        return "1"
    elif type_name == "object":
        return "PyInt_Check(%s)" % operand
    else:
        return "0"

add_template_str = r"""
PyObject *BINARY_OPERATION_ADD_{{toHelperName(left.type_name)}}_{{toHelperName(right.type_name)}}(PyObject *operand1, PyObject *operand2) {
    CHECK_OBJECT(operand1);
    CHECK_OBJECT(operand2);

#if PYTHON_VERSION < 300
    // Something similar for Python3 should exist too.
    if ({{isInt(left.type_name, "operand1")}} && {{isInt(right.type_name, "operand2")}}) {
        long a, b, i;

        a = PyInt_AS_LONG(operand1);
        b = PyInt_AS_LONG(operand2);

        i = a + b;

        // Detect overflow, in which case, a "long" object would have to be
        // created, which we won't handle here.
        if (likely(!((i ^ a) < 0 && (i ^ b) < 0))) {
            return PyInt_FromLong(i);
        }
    }
#endif

    binaryfunc slot1 = NULL;
    binaryfunc slot2 = NULL;

    PyTypeObject *type1 = Py_TYPE(operand1);
    PyTypeObject *type2 = Py_TYPE(operand2);

    if (type1->tp_as_number != NULL && NEW_STYLE_NUMBER(operand1)) {
        slot1 = type1->tp_as_number->nb_add;
    }

    if (type1 != type2) {
        if (type2->tp_as_number != NULL && NEW_STYLE_NUMBER(operand2)) {
            slot2 = type2->tp_as_number->nb_add;

            if (slot1 == slot2) {
                slot2 = NULL;
            }
        }
    }

    if (slot1 != NULL) {
        if (slot2 && PyType_IsSubtype(type2, type1)) {
            PyObject *x = slot2(operand1, operand2);

            if (x != Py_NotImplemented) {
                if (unlikely(x == NULL)) {
                    return NULL;
                }

                return x;
            }

            Py_DECREF(x);
            slot2 = NULL;
        }

        PyObject *x = slot1(operand1, operand2);

        if (x != Py_NotImplemented) {
            if (unlikely(x == NULL)) {
                return NULL;
            }

            return x;
        }

        Py_DECREF(x);
    }

    if (slot2 != NULL) {
        PyObject *x = slot2(operand1, operand2);

        if (x != Py_NotImplemented) {
            if (unlikely(x == NULL)) {
                return NULL;
            }

            return x;
        }

        Py_DECREF(x);
    }

#if PYTHON_VERSION < 300
    if (!NEW_STYLE_NUMBER(operand1) || !NEW_STYLE_NUMBER(operand2)) {
        int err = PyNumber_CoerceEx(&operand1, &operand2);

        if (unlikely(err < 0)) {
            return NULL;
        }

        if (err == 0) {
            PyNumberMethods *mv = Py_TYPE(operand1)->tp_as_number;

            if (mv) {
                binaryfunc slot = mv->nb_add;

                if (slot != NULL) {
                    PyObject *x = slot(operand1, operand2);

                    Py_DECREF(operand1);
                    Py_DECREF(operand2);

                    if (unlikely(x == NULL)) {
                        return NULL;
                    }

                    return x;
                }
            }

            // CoerceEx did that
            Py_DECREF(operand1);
            Py_DECREF(operand2);
        }
    }
#endif

    // Special case for "+", also works as sequence concat.
    PySequenceMethods *seq_methods = Py_TYPE(operand1)->tp_as_sequence;

    if (seq_methods && seq_methods->sq_concat) {
        PyObject *result = (*seq_methods->sq_concat)(operand1, operand2);

        if (unlikely(result == NULL)) {
            return NULL;
        }

        return result;
    }

    PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for +: '%s' and '%s'", type1->tp_name, type2->tp_name);

    return NULL;
}
"""

add_template = jinja2.Template(add_template_str)

types = (int_details, float_details, object_details)

for left in types:
    for right in types:
        print(add_template.render(left=left, right=right,
                                  # TODO: Move thoses ones to environment "env"
                                  toHelperName=toHelperName, isInt=isInt))

In my mind, the TODO item about env is crap, those free functions should simply be methods of the type descriptions, that most probably should simply be objects, and then you call left.isInt() and go from there.

@kayhayen I am left with one more doubt that the code that we mocked up was in python and jinja, the code that have to be implemented within r""" """ should be implemented in python right?
Means overall I wanted to ask that is there a roll of C language in these functions implementation or only jinja2 and python?

Hey @kayhayen can you look into this once and clear this doubt as well :)

@riya-17 You are supposed to generate only C code. You are supposed to use Python and Jinja2 to do that. Inside the templates, I expect therefore C code template, expanded using Jinja2.

@kayhayen So the code inside r""" code """ needs to be in C language and handled with the help of template. right?

@kayhayen Sorry for these many questions but this time I don't want to misunderstand anything due to which I am confirming my doubts So that I don't get wrong this time and able to produce results soon.

@riya-17 It's not a problem, but wasn't my comment right before saying that?
Do you understand, what the template language is? Which one is that?
Do you understand, what the templated language is? Which one is that?
Do you understand, what the glue language is? Which one is that?
In an ideal world, you would figure those answers out. :-)

@kayhayen Thank you :) I will figure out :)


Source maps for web are not showing original code but ES5

Describe the bug
Source maps for web are not showing original code but ES5
To Reproduce
Steps to reproduce the behavior:

Run command 'rnv new testproject'
In wizard select renative-template-hello-world
Run command 'npx rnv run -p web'

not needed to turn on source maps. They are there by default. It is caused by default next option devtool: eval-source-map of webpack.

Expected behavior
Inspect the web (F12) and you can see original code of _app.js:
import React from 'react';
import { useRouter } from 'next/router';
import { View } from 'react-native';
import Menu from '../components/menu';
import { themeStyles, ThemeProvider } from '../config';

export default function MyApp({ Component, pageProps }) {
    const router = useRouter();
    return (
        <ThemeProvider>
            <Menu focusKey="menu" router={router} />
            <View style={themeStyles.appContainer}>
                <Component {...pageProps} />
            </View>
        </ThemeProvider>
    );
}

But I see ES5 code:

Desktop (please complete the following information):

OS: [macOS 12.6]
Node Version [v16.14.2]
RNV Version [e.g. 0.35.4]

I created also clean next.js project and the source code is correct:

Related to https://github.com/flexn-io/renative/issues/953

this is no longer the issue in 1.0.0-rc.18.


[Snyk] Upgrade commons-io:commons-io from 2.13.0 to 2.15.0

This PR was automatically created by Snyk using the credentials of a real user.Snyk has created this PR to upgrade commons-io:commons-io from 2.13.0 to 2.15.0.
:information_source: Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.

The recommended version is 2 versions ahead of your current version.
The recommended version was released 2 months ago, on 2023-10-21.

Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs.
For more information:
🧐 View latest project report
🛠 Adjust upgrade PR settings
🔕 Ignore this dependency or unsubscribe from future upgrade PRs

Current version is 2.15.1


Sticky fastforward on chrome for android

Games often get stuck in fastforward and zoom to the end of the game, no matter what I do.  It seems to occur when I tap forward several times in rapid succession.  At the end of the game if I try to go back it

... will start flashing the result of the game on the screen as it immediately fastforwards each time I move back.


[Java] Update Maven modules to use latest Apache Parent (31) and plugins

Describe the enhancement requested
Apache Java Arrow root project depends on Apache Parent 18 as its default configuration which is fairly odd nowadays. Some modules do not even use Apache Parent at all.
To keep the build stack clean, up-to-date and pave the way to support newer java versions for example, modules should be updated and cleaned up to use Apache Parent 31[^1], recent plugins, and remove unnecessary version/configuration when already defined in the parent modules.
[^1]: Apache Parent 32 has just been released but use --release by default which does not work well with Arrow use of sun.misc.Unsafe
Component(s)
Java

Issue resolved by pull request 41309
https://github.com/apache/arrow/pull/41309

@github-actions crossbow submit test-conda-python-3.10-spark-v3.5.0

@github-actions  crossbow submit test-conda-python-3.10-spark-v3.5.0


Update Macaw.php

This solves the double slash problem. (which is essentially solving #26 #33)

The array is a print_r from Macaw::$routes

Awesome. :+1:


Add EmojiPicker and Emoji components

Add EmojiPicker and Emoji components

This update adds 2 new components: <EmojiPicker /> and <Emoji />. Both of these components are light wrappers around the components provided by the emoji-mart library.
The strategy I used to tweak the styles EmojiPicker was to structure the EmojiPicker/*.scss files as if we had smaller components, exactly like how we structure the CSS for other Blue components.
Each .scss file under EmojiPicker is scoped under the main component class. This allows the styles to not leak into global scope, and it allows for us to easily override the default library styles in an easy-to-understand + maintainable way.
Resolves: https://github.com/helpscout/blue/issues/26

Coverage remained the same at 100.0% when pulling bdc99f7d791f271a466660675c9453cf8f4d58b3 on emoji-picker into 056114af4518c59e8fa298e421e50d34a169f2fd on master.


Changing the TCP / IP Fingerprint

Been using this to selfhost a few proxies myself.
Some well known providers are using TCP/IP fingerprinting to detect whether the user is behind a proxy.
I was wondering whether it was possible to simply change the TCP options?
Mainly the TCP window buffer size is mainly OS dependent, and they are checking whether the OS of the tcp connection is mismatching with real client.
https://linux.die.net/man/7/tcp
According here we can change SO_RCVBUF but doing my own testing that didn't seem to change the TCP window size

I'm not familiar with TCP fingerprinting, do you know what are some best practices?


[5.1] Prevent $config conflicts within config files

Sometimes, config files require a special logic, such as specific configuration within different environments. This can lead to changing a config from from:
return [
    // ...
];

to something like:
$config = [];

if (some_conditional) {
    $config['foo'] = [
        // ...
    ];

    if (some_other_conditional) {
        $config['foo']['bar'] = 'baz';
    }
}

return $config + [
    // ... remaining config
]

This is great, but using the most likely variable name, $config, will actually cause an exception to be thrown. This exception can be very unexpected, and takes a bit to track down the issue.
Fatal error: Call to a member function set() on array in [path]/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php on line 56

Changing the variable symbol within the LoadConfig::loadConfigurationFiles() will prevent this.

Thanks @lukasgeiter, nice catch! I made the change.


.NET Core version

I managed to convert System.IO.Abstractions to .NET Core. Methods that are not part of that are disabled using #if NET45.
The tests were converted to XUnit, as there are compatibility issues with NUnit.
There is a bug in VS 2017 RC which prevents setting AssemblyVersion and so on, so that needs to be fixed.
All tests are green. Feel free to do whatever you please with it.

Is there progress on this?

See See https://github.com/tathamoddie/System.IO.Abstractions/pull/221


[OF-1097] test: Add unit tests for Optional

connected-spaces-platform Pull Request
For the reviewer

[ ] If required, are the changes covered by appropriate tests?
[ ] Are any public-facing API changes well documented?
[ ] Is the code easily readable and extensible and/or follow existing conventions?

I think we should probably update Optional's move constructor to invalidate RHS as we have done with other csp::common types.

I think we should probably update Optional's move constructor to invalidate RHS as we have done with other csp::common types.

I'm not sure doing that as part of adding the testing is a good idea. It would change this ticket from just adding testing to changing functionality. Do you think we should do it now or create a ticket to track doing it at a later stage?

I'm not sure doing that as part of adding the testing is a good idea. It would change this ticket from just adding testing to changing functionality.

Fair enough.


feat/activity-graphql

[ ] I wrote tests for the feature
[ ] I documented the feature if needed

If the feature is a refactor, please explain why your way is better

Center the trash in lookupTable in synonyms and gazette tabs

And add some margin for the values on the left


RE: Is the API going to change in future releases?

Hi, I wanted to enquire as I believe this is not a stable release, is the API going to change with each update(s)? If so by how much is it going to change?

Hey ! Yes tui is not stable and futures releases may contain breaking changes. As I've said in the past and although the crate has been around for quite some time, its recent popularity has triggered a lot of feedback and thus highlighted its shortcomings that would need to be addressed before I can consider it stable. Having said that, I try to make API changes only when they make sense and provide detailed instructions in the CHANGELOG to ease the upgrade process.
I hope this answer your question :).


NavigationView opens Pane when "changing" from LeftMinimal to LeftMinimal

Describe the bug

When a NavigationView is in LeftMinimal PaneDisplayMode, and you set the PaneDisplayMode to LeftMinimal, the pane opens.
Related to #1702
Steps to reproduce the bug

Steps to reproduce the behavior:

Set NavigationView to LeftMinimal
Set it to LeftMinimal again

Expected behavior

The pane should stay closed.
Screenshots

Version Info

NuGet package version:

MUXC: Latest commit on master

Windows 10 version
Saw the problem?

Insider Build (19536)
Yes

May 2019 Update (18362)

October 2018 Update (17763)

April 2018 Update (17134)

Fall Creators Update (16299)

Creators Update (15063)

Device form factor
Saw the problem?

Desktop

Mobile

Xbox

Surface Hub

IoT

Additional context

This issue was addressed with #1788, closing it now.


Add first draft of dns-sd testing

Hi! this is the basic script that I was working on these days. Not sure if it is super useful but it tests both roles when using MDNS / SD for WoT discovery. It can be used also from the command line and it has a bunch of configurations (e.g. which role you want to test or type). It might be reused inside node-wot or webthings.io to assert compliance to the spec.

Thanks. I did some restructuring to accommodate for your additions.


Interface support

Hi, I'm trying to make a simple Swing binding to idris, but i want to make sure that a class implements a specific interface. Is that possible?

Hi,
Yes, it is possible. Here is an example:
exports : FFI_Export FFI_JVM "hello/IdrisThread extends java/lang/Thread implements java/lang/Runnable" []
exports1 =
  Fun idrisThreadConstructor Constructor $
  Fun idrisThreadWithNameConstructor Constructor $
  Fun run ExportDefault $
  Fun getThreadName (Super "getName") $
  End

The above export section creates a class called IdrisThread which extends Java Thread class and implements Runnable. In the exported class as you can see, it exports two Idris functions (idrisThreadConstructor and idrisThreadWithNameConstructor) as constructors, run function exported with the same name for Java which becomes the implementation for run method and the last declaration getThreadName calls super class method getName. The complete example is here.

I meant when "importing" a class, not exporting. I noticed the exporting when looking at the FFI examples.

Sorry, I misunderstood. Do you mean to make sure in Idris that a Java class implements some interface? If yes, that is not possible as there is no concept of Java class files during Idris compilation so a Java class file cannot be inspected. This is a good thing as otherwise we have to introduce the concept of classpath for the code generation and would involve loading classes for inspection during compilation.

Well, I mean more that i have to specify what interfaces it implements, like with Inherits.

Closing this now as the answer is to use Inherits to specify what a class inherits. Please reopen if you have more questions.


Update and apply scalafmt

Updates and applies scalafmt

Pull Request Test Coverage Report for Build<PHONE_NUMBER>

0 of 0   changed or added relevant lines in 0 files are covered.
2 unchanged lines in 1 file lost coverage.
Overall coverage decreased (-0.5%) to 75.328%

Files with Coverage Reduction
New Missed Lines
%

core-s3/src/main/scala/io/aiven/guardian/kafka/s3/Config.scala
2
80.85%

Totals

Change from base Build<PHONE_NUMBER>:
-0.5%

Covered Lines:
287

Relevant Lines:
381

💛  - Coveralls


(cloud-1747) Fixing docker UCP uninstall

This PR updates the flag being used to uninstall UCP. Currently uninstall is being passed but the uninstall command has been changed in ucp to uninstall-ucp. I have confirmed that UCP is now being uninstalled successfully.

LGTM


Move hacky flag to common

Description
At least until we can get rid of it. Unblocks google3 roll.

Landing to unblock roll


x/pkgsite: package removal request for github.com/nywilken/go-cty/v2

What is the path of the package that you would like to have removed?
github.com/nywilken/go-cty/v2

Are you the owner of this package?
Yes

What is the reason that you could not retract this package instead?
This pkg is completely invalid and was published incorrectly. The repo https://github.com/nywilken/go-cty has since been updated to reflect that it is a fork of https://github.com/zclconf/go-cty and should not be used directly. While working with with a new repository at github.com/hetznercloud/packer-plugin-hcloud I found that this dependency is being suggested as a potential upgrade to the forked version, which is not correct.

In hindsight I think a retraction might just be okay. I'll close this issue and give it a go.


Issue installing pg_cron locally

Bug report
Describe the bug
Trying to install pg_cron locally but I'm facing the following issue:
zsh:~$ supabase init
zsh:~$ echo "create extension if not exists pg_cron;" > supabase/migrations/000_add_pg_cron.sql
zsh:~$ supabase start
Error: Error starting database: ERROR:  can only create extension in database postgres
DETAIL:  Jobs must be scheduled from the database configured in cron.database_name, since the pg_cron background worker reads job descriptions from this database.
HINT:  Add cron.database_name = 'main' in postgresql.conf to use the current database.
CONTEXT:  PL/pgSQL function inline_code_block line 4 at RAISE

Expected behavior
I'm not sure what's an appropriate way to update cron.database_name based on the branch name.
For instance, I tried adding this to the migration file:
select set_config('cron.database_name', 'main', false); -- or true

But then I get the following error:
Error: Error starting database: ERROR:  parameter "cron.database_name" cannot be changed without restarting the server

System information

OS: macOS
cli: 0.17.0

Additional context
By the way, the error above prevents other containers from starting. If you run docker ps, only the db container would be running.

Interesting - I think this is a similar problem to #137.

I actually ended up doing that but for some reason the jobs are not executed. I couldn't figure out why and I'm not sure if it's related to branching or something else.
To Reproduce:

In a fresh supabase instance, run the following:

create extension if not exists pg_cron;

-- I don't think this is necessary for superuser
grant usage on schema cron to postgres;
grant all privileges on all tables in schema cron to postgres;

create table if not exists public.events (
  id integer generated always as identity,
  name text,
  created_at timestamp with time zone DEFAULT now() NOT NULL
);

insert into events (name) values
('one'),
('two'),
('three'),
('four'),
('five');

create or replace function public.clean_events_table()
RETURNS void
as $$
begin
  delete from public.events;
end;
$$ language plpgsql security definer;

-- every minute
SELECT cron.schedule('clear events table', '* * * * *', 'CALL clean_events_table()');

confirm the job exists: select * from cron.job;:

jobid
schedule
command
nodename
nodeport
database
username
active
jobname

1
* * * * *
CALL clean_events_table()
localhost
5432
postgres
postgres
true
clear events table

After one minute, the public.events table will not be cleared and running select * from cron.job_run_details; does not show any executed jobs.

Ah yeah, it doesn't exactly "work" - as with #137, the background worker for pg_cron fails to start so the jobs don't get executed.

@soedirgo can confirm -- restarting the database container manually made it work as suggested in #137

Have the same issue attempting to enable pg_cron via migrations. #263 mentioned an undocumentated /supabase/extensions.sql file, but I haven't managed to enable pg_cron there, from from a normal migration file such as /supabase/migrations/pg_cron.sql.
drop extension if exists pg_cron;
create extension if not exists pg_cron;
grant usage on schema cron to postgres;
grant all privileges on all tables in schema cron to postgres;

The error:

% supabase start
Error: Error starting database: ERROR:  can only create extension in database postgres
DETAIL:  Jobs must be scheduled from the database configured in cron.database_name, since the pg_cron background worker reads job descriptions from this database.
HINT:  Add cron.database_name = 'main' in postgresql.conf to use the current database.

This is fixed since v1.4.7 as we restart the db container after initialisation. The underlying issue was that we rely on pg_terminate_backend when switching/restoring databases and that closes all background worker connections. You may refer to https://github.com/supabase/cli/pull/465 for more details.

@sweatybridge I don't know if this should be closed, as the previously mentioned error is still there when adding the pg_cron extensions in a migration. I put the create extensions in the migration since the extensions.sql should be deprecated.
I tried with the latest supabase version (1.6.0)
Migration:
create extension if not exists pg_cron with schema extensions;

Error after supabase start goes through the first migration with the create extension:
Error: Error starting database: ERROR:  can only create extension in database postgres
DETAIL:  Jobs must be scheduled from the database configured in cron.database_name, since the pg_cron background worker reads job descriptions from this database.
HINT:  Add cron.database_name = 'main' in postgresql.conf to use the current database.

I tried also select set_config('cron.database_name', 'main', false); but seems that parameter "cron.database_name" cannot be changed without restarting the server.
Is that something wrong on my side or is this problem still there?

@413n you are right. There are 2 separate errors here, one resolved by restarting background worker and the other one is still outstanding.
Essentially we need to create pg_cron extension in the postgres database. I will keep this ticket open as we work on it.

Thank you for your patience in this issue. I've tested it be working locally with our latest release. Please let me know if things are still broken.


Fixing issue #11 $emarsysApiEventID not defined

This fix issue #11

Many thanks Laurent,
We will verify it and merge it in.
Thanks
Guy


eget: init at 1.1.0

Description of changes
Easily install prebuilt binaries from GitHub.
https://github.com/zyedidia/eget

Things done

Built on platform(s)

[x] x86_64-linux
[ ] aarch64-linux
[ ] x86_64-darwin
[ ] aarch64-darwin

[ ] For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
[ ] Tested, as applicable:

NixOS test(s) (look inside nixos/tests)
and/or package tests
or, for functions and "core" functionality, tests in lib/tests or pkgs/test
made sure NixOS tests are linked to the relevant packages

[ ] Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
[x] Tested basic functionality of all binary files (usually in ./result/bin/)
22.11 Release Notes (or backporting 22.05 Release notes)

[ ] (Package updates) Added a release notes entry if the change is major or breaking
[ ] (Module updates) Added a release notes entry if the change is significant
[ ] (Module addition) Added a release notes entry if adding a new NixOS module
[ ] (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes

[x] Fits CONTRIBUTING.md.

Keep in mind that on Nixos only static linked binaries will work out of the box and this is also against the very idea of Nixos.

Maybe useful for non-nixos? Also eget --download-only was useful for me sometimes.


Create merge_sort_tanvi.c

adding merge sort for hactober fest

Read the guidelines carefully. make sure you follow and star the repository!


Code release

Thank you for your contribution. Is this article still open source? Isn’t it said that it will be open source before December?

Sorry for the delay, we have released our code now.


ToDo

The poseidon2 package format and the .janno file

[ ] Finish the definition of the .janno file structure/content
[x] Create a comprehensive, open, git observed documentation (and therefore a standard) of the poseidon2 package format and the .janno file based on the README here, the relevant fragments in the palaeowiki and the .janno google docs sheet.

Department procedures

[x] Come up with a workflow to get data into the poseidon2 format
[x] Identify features the poseidon2 cli tool should provide to make this as easy as possible

The poseidon2 R package/cli tool

[ ] Identify necessary features beyond the core abilities already implemented (merge, validate, convert plink-binary2eigenstrat)
[x] Make a design decision: Is a cli tool based on R fine? Should we try to separate R functionality and cli functionality as we did with sidora (I would argue that we do not have to)? Should we reimplement with yet another language/framework to be more elegant and maybe future-proof (Haskell)?
[x] Write proper documentation (including DESCRIPTION, README and at least a quickstart guide)
[ ] Atomize the current code and write unit tests
[ ] Test and review the code to make it very robust
[ ] Decide when input validation should stop the program and when it should only inform the user
[ ] Invent more sophisticated test data
[x] Simplify the cluster setup and find a way to automate the sbatch call
[x] Activate CD/CI testing
[x] Automate installation (and maybe cluster deployment)
[x] Document not just the R dependencies, but also the system requirements
[ ] ~Make the anno2janno transformation module available and sufficiently generic and robust to work with most anno files out there. At least on a basic level~
[x] Add validation for .bed, .bim and .fam files
[x] Make the software fully independent of our cluster architecture and allow for calls to local software
[x] Provide the whole package with system dependencies (including plink etc.) in a docker container or similar

GO HASKELL!

But seriously, thanks for this list. Very comprehensive, indeed. I think with respect to tooling, I would vote for not tying ourselves too closely into R. It's totally OK to have the first CLI tooling to be provided for working with this data based on your R CLI, and it's very well possible that this will remain the main tool for a while, but given the standard is well defined, I'd be looking forward to invest some time in other programming languages as well. But that can go secondary.

Ja. Haskell would actually be a good choice for all these parsing and validation operations. And I would really like to have an excuse to work with it.
But I'm much faster with R and we already established a CLI setup with it for sidora recently. Also a lot more people can read and write it.

Outdated - all of this DID go to Haskell eventually.


Shortcut cw

From @Kiev-Junta on October 17, 2016 19:43

VSCode Version: Code 1.6.1 (9e4e44c19e393803e2b05fe2323cf4ed7e36880e, 2016-10-13T15:43:46.054Z)
OS Version: Linux x64 4.4.0-31-generic
Extensions: ms-vscode.csharp-1.4.1, robertohuertasm.vscode-icons-3.0.5

Steps to Reproduce:
"cw - tab tab" generates System.Console.WriteLine() instead of Console.WriteLine(). (using System exists, namespace name is different)
Copied from original issue: Microsoft/vscode#13903

This is a duplicate of #104

Yes, this is a duplicate. There is also an issue open on VS Code to allow smarter code snippets: https://github.com/Microsoft/vscode/issues/10561.


Feature: Primary Chat

Validations

[X] I believe this is a way to improve. I'll try to join the Continue Discord for questions
[X] I'm not able to find an open issue that requests the same enhancement

Problem
While working on some code let's say terraform with docker you could ask and get the all the code needed. But sometime's there's a case where you might have an additional question related to the problem but it's more of completely separate question about docker. Which would be out of context of given the problem i want to solve. Currently you either ask the question in same chat or create new chat. Both have there +s and -s.
Solution
It would be a feature called: Primary Chat. While your main task remains easy to access the other queries can go separately. This can be solved either by UI or keyboard shortcuts. But both will have very different UX. probably pair of both.
My preference is to keyboard shortcuts for minimal POC. The workflow could be:

You start a normal chat.
Use some "Magic Set" keyboard shortcut to mark the current chat as primary chat.
If you got any new question you start a new chat CMD + L
Need to go back to primary chat? use "Magic Go" keyboard shortcut to return to primary chat.
You can change the primary chat by using same Magic Set shortcut.

Additionally there could be more UI improvements that would have:

primary chat pinned to top or some icon somewhere.
UI to mark current chat as primary

This feature could be really useful for learning new tools and technologies and also doing quick research. Possibly in the future this can be extended into "Learn along with Continue."

Interesting idea! I find myself doing this quite often as well. It feels like the root of the issue is "I want to easily submit a prompt and get a response, without affecting the current session".
Keyboard shortcuts are definitely a lightweight way to do this. Although it feels like an even more lightweight way to do this could be just adding a shortcut to return to previous session?

Not sure if going back to the previous session would work for more than one additional chat session. The previous session must be going to the very last session from history.

Could approach as "pinned chat" where you can pin a specific chat to the top at any time, unpin at any time, and pin icon or similar + keyboard shortcut would go to pinned chat


Validate OUI theme compliance - phase 1

This is a tracking issue for phase 1 of OUI theme plugin compliance, which will involve changes to OUI typography and color SASS variables (for both dark and light mode). For full details, including dates and tooling, see https://github.com/opensearch-project/OpenSearch-Dashboards/issues/4291
If your plugin has no UI views or components, please add a comment to that effect, and we'll remove the repo from future look and feel update campaigns.
Actions required

[ ] Acknowledge the issue by adding an assignee who will serve as a point-of-contact
[ ] Provide screenshots and navigation instructions for important views and screens in your plugin or application. This will assist with both manual and automatic validation of compliance
[ ] Identify all typographic properties and styles
[ ] Create issues to mitigate typographic styles not inherited from OUI components or SASS variables
[ ] Identify all color values, including visualization colors and palettes
[ ] Create issues to mitigate typographic styles not inherited from OUI components or SASS variables
[ ] Resolve all mitigation issues
[ ] Validate and test plugin with updated OUI theme

Questions?
Add a comment on https://github.com/opensearch-project/OpenSearch-Dashboards/issues/4291

Known visualization color palette actions required
As part of OUI theme color compliance, all visualization colors should reference OUI color palette functions: https://oui.opensearch.org/1.0/#/utilities/color-palettes
In auditing visualization palettes, we identified several actions required for Observability visualizations to use the right colors (tracked in https://github.com/opensearch-project/OpenSearch-Dashboards/issues/4318).
Qualitative

[ ] [Vis colors] Replace observability plotly colors with ouiPaletteColorBlind()
[ ] [Vis colors] Replace observability default series color with ouiPaletteColorBlind()[0]

Quantitative

[ ] [Vis colors] Replace observability color scales with palettes generated with colorPalette and OUI color variables
[ ] [Vis colors] Replace observability trace analytics color palettes with palettes generated with colorPalette and OUI


az functionapp keys list throws 'Bad Request'

Describe the bug
Command Name
az functionapp keys list
Errors:
Operation returned an invalid status 'Bad Request'

The app name and resource group are correct since az functionapp show -g {} -n {} with the same values works.
To Reproduce:

Linux Function App v4.
Configured to pull container image from Azure Container Registry using managed identity.
Storage Account has been created with --public-network-access Disabled.
az functionapp keys list -g {} -n {}

Expected Behavior

Lists the keys (or shows an empty list like I would've expected in this particular case) or
more informative error message.

Environment Summary
Linux-4.4.0-19041-Microsoft-x86_64-with-debian-bullseye-sid, Ubuntu 20.04 LTS
Python 3.6.10
Installer: DEB

azure-cli 2.31.0

Extensions:
aks-preview 0.5.49

Additional Context

route to service team

I updated the steps to reproduce. This is most likely related to the fact that the storage account was created with --public-network-access Disabled. However, when trying to create a minimal setup that reproduces this issue, I couldn't get it to throw Bad Request.  We notice that this step sometimes randomly fails with a "Bad Request", and when we try to retrieve the key a few minutes later it succeeds.
This is the command:
az functionapp keys list -g "xxxxx" -n "xxxxx" --query "masterKey" --output tsv
This is the error reported by 'az':
ERROR: Operation returned an invalid status 'Bad Request'
And the Activity Log on the Function App contains an entry similar to this:
{
    "eventName": {
        "value": "EndRequest",
        "localizedValue": "End request"
    },
    "level": "Error",
    "operationName": {
        "value": "Microsoft.Web/sites/host/listkeys/action",
        "localizedValue": "List Web Apps Functions Host Keys"
    },
    "resourceId": "/subscriptions/xxxxxxxx/resourceGroups/xxxxxxxx/providers/Microsoft.Web/sites/xxxxxxxx/host/default",
    "status": {
        "value": "Failed",
        "localizedValue": "Failed"
    },
    "subStatus": {
        "value": "BadRequest",
        "localizedValue": "Bad Request (HTTP Status Code: 400)"
    },
    "properties": {
        "statusCode": "BadRequest",
        "serviceRequestId": null,
        "statusMessage": "{\"Code\":\"BadRequest\",\"Message\":\"Encountered an error (InternalServerError) from host runtime.\",\"Target\":null,\"Details\":[{\"Message\":\"Encountered an error (InternalServerError) from host runtime.\"},{\"Code\":\"BadRequest\"},{\"ErrorEntity\":{\"Code\":\"BadRequest\",\"Message\":\"Encountered an error (InternalServerError) from host runtime.\"}}],\"Innererror\":null}",
        "eventCategory": "Administrative",
        "message": "Microsoft.Web/sites/host/listkeys/action",
    }
}

I'm not sure what the previously mentioned --public-network-access option does and I don't think it's related to our issue, but for completeness sake I'll mention that our storage account is created via an ARM template incremental deployment with the following properties:
    "properties": {
        "allowBlobPublicAccess": false,
        "minimumTlsVersion": "TLS1_2",
        "supportsHttpsTrafficOnly": true,
        "networkAcls": {
            "bypass": "AzureServices",
            "virtualNetworkRules": [
                {
                    "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vnet-name'), variables('subnet-streamprocessor-name'))]",
                    "action": "Allow"
                }
            ],
            "ipRules": [],
            "defaultAction": "Deny"
        }
    },

Can we get an update on this please. I've been dealing with this issue for several months now and it seems very hit or miss as to whether this az cli request works or not. If it was broken then I'd be more understanding but the variability of the request succeeding is most frustrating. Also, I've tried with both public network access and allow blob public access enabled and I still get this issue:

FYI, this is failing in the Azure Portal also for certain functions that have function key interactions:

Look like no update from microsoft, same issue with windows function app v4

hey all - it would be best to open a support case for these - since this is not specific to CLI. I did try to report these to the function apps team directly, but not something we can take action via CLI.

Yes would be best to open a support ticket or you can transfer this issue to the Functions Host repo: https://github.com/Azure/azure-functions-host/issues

route to CXP to help here.. Thanks!

Az CLi was onboarded to CXP from Feb 1st. Removing the CXP Attention label from this issue considering this issue was created in Jan.
CC @yonzhan

Is there any update?
Steps to reproduce:

az storage account create --name $(StorageAccountName) --resource-group $(StorageResourceGroupName)
az appservice plan create --name $(AppServicePlanName) --resource-group $(AppServicePlanResourceGroupName) --sku $(AppServicePlanSku) --location $(AppServicePlanLocation)
az functionapp create --resource-group $(FunctionResourceGroupName) --plan $(AppServicePlanPath) --name $(FunctionName) --storage-account $(StorageAccountPath) --functions-version $(FunctionVersion) --os-type $(FunctionOs) --runtime dotnet --disable-app-insights true --app-insights-key $(ApplicationInsightsImbasKey) --subnet $(FunctionSubnetPath)
az functionapp keys list --name $(FunctionName) --resource-group $(FunctionResourceGroupName)

Last command returns: Operation returned an invalid status 'Bad Request'
az rest command returns:

az rest --method post --uri "/subscriptions/xyz/resourceGroups/rg-func/providers/Microsoft.Web/sites/func-test/host/default/listKeys?api-version=2022-03-01" --query functionKeys.default --output tsv

Bad Request({"Code":"BadRequest","Message":"Encountered an error (InternalServerError) from host runtime.","Target":null,"Details":[{"Message":"Encountered an error (InternalServerError) from host runtime."},{"Code":"BadRequest"},{"ErrorEntity":{"Code":"BadRequest","Message":"Encountered an error (InternalServerError) from host runtime."}}],"Innererror":null})

Also in the Azure Portal the App Key are not shown and cannot be set:

Do I miss something how to create a function using azure cli? How can I add a key to my function?

Is there any update? Steps to reproduce:

az storage account create --name $(StorageAccountName) --resource-group $(StorageResourceGroupName)
az appservice plan create --name $(AppServicePlanName) --resource-group $(AppServicePlanResourceGroupName) --sku $(AppServicePlanSku) --location $(AppServicePlanLocation)
az functionapp create --resource-group $(FunctionResourceGroupName) --plan $(AppServicePlanPath) --name $(FunctionName) --storage-account $(StorageAccountPath) --functions-version $(FunctionVersion) --os-type $(FunctionOs) --runtime dotnet --disable-app-insights true --app-insights-key $(ApplicationInsightsImbasKey) --subnet $(FunctionSubnetPath)
az functionapp keys list --name $(FunctionName) --resource-group $(FunctionResourceGroupName)

Last command returns: Operation returned an invalid status 'Bad Request'
az rest command returns:

az rest --method post --uri "/subscriptions/xyz/resourceGroups/rg-func/providers/Microsoft.Web/sites/func-test/host/default/listKeys?api-version=2022-03-01" --query functionKeys.default --output tsv

Bad Request({"Code":"BadRequest","Message":"Encountered an error (InternalServerError) from host runtime.","Target":null,"Details":[{"Message":"Encountered an error (InternalServerError) from host runtime."},{"Code":"BadRequest"},{"ErrorEntity":{"Code":"BadRequest","Message":"Encountered an error (InternalServerError) from host runtime."}}],"Innererror":null})

Also in the Azure Portal the App Key are not shown and cannot be set:
Do I miss something how to create a function using azure cli? How can I add a key to my function?

@MrMeterPing unfortunately, since this is not a CLI client specific problem but rather API/runtime please use the link above to report the issue https://github.com/Azure/azure-functions-host/issues & some one from functions team can help move this forward. //CC: @anirudhgarg


Consider auto-populating DD_* env vars with sensible defaults

While trying to set up Datadog CI tests integration, for a while I thought the following steps were all that was necessary:

It took me a while to realise that I also needed to set the following environment variables:

Perhaps it would be useful to have this action set those environment variables by default? This PR probably shouldn't be merged as-is, it's more a demo of what I am suggesting. Feel free to close this PR and implement it yourself with docs, etc.

Hello @aidansteele,
Thank you very much for the feedback. We are looking for ways to make the onboarding experience smoother. You are right that setting some sensible defaults for the environment and service is most likely the way to go.
That been said, this action only focus is to start and gracefully stop the agent. The test environment and service are specific to the tests being run, thus this should be handled by the tracer used in the tests. This is because if there are multiple test sets running in the same job they could be for different services or/and environments.
This is why we will look into updating the tracers to make sure they set sane defaults for the environment and test service if none is provided.

Ah that makes sense, thank you for such a quick and detailed reply.


Code fix: SA1600 (ElementsMustBeDocumented)

Implement a code fix for #120.
In general the code fix would create the necessary XML elements in a new documentation comment, but not fill in the details. However, for certain cases we can fill in these details. For example:

The <summary> element for constructors and finalizers can be created according to SA1642 and SA1643.

If the member needing documentation overrides or implements a member from a base class or interface, the content can be simplified to just <inheritdoc/>.

If the member returns a Task, the <returns> element should read as follows (note we may use different wording):
A <see cre="Task"/> representing the result of the asynchronous operation.

Rusult!

@oatkins :expressionless:

Hi,
I think sometimes the details can be filled in.
In the case of a properly named property it would be helpful.
public string VogonConstructorFleets { get; set; }

Could quite easily be documented as:
/// <summary>
/// Gets or sets the vogon constructor fleets
/// </summary>

I think there is value in this, particularly in the case of correctly named properties.
It's a real time saver.
thoughts?

@jimmymain It was my impression that several people working on this find automatically-generated documentation wrong (or useless) more frequently than it is correct (or useful). Right now I can't find the conversation I was thinking of. While they obviously have good intentions, I'm definitely not a fan of the behavior of tools like GhostDoc.
That said, please keep the following in mind:

Feel free to create a proposal describing specific behavior you had in mind.
You can always implement a code fix for SA1600 separately from this project, and install it in the same project(s) where you use StyleCop Analyzers. For example, the InheritdocCodeFixProvider in this project handles CS1591 warnings, which are not produced by this project. Anyone who finds it useful can install and use it.

:memo: While I would likely vote against adding this behavior directly to the StyleCopAnalyzers repository, I would not have any objection to creating an additional repository in the DotNetAnalyzers organization aiming to provide more comprehensive documentation generation features.

On the whole, I agree, though my feeling is that my case for properties is pretty strong.
I will implement a fix separately and post a link to it.

The documentation rules are there for a reason. The developer should write documentation that helps someone who reads the code to better understand it. Auto generated documentation for properties do not provide any value at all and the only effect it has is that it suppresses the diagnostic. This defeats the purpose.

Hi,
I understand and appreciate your point of view.
There are however a lot of cases where simple POCO objects are used. The
code fix would save time as the properties are self documenting.
There should then be a convenient way of suppressing the analysis for only
these POCO instances - which I also don't think is practical.
On Thu, 12 Nov 2015 at 13:06 Dennis Fischer<EMAIL_ADDRESS>wrote:

The documentation rules are there for a reason. The developer should write
documentation that helps someone who reads the code to better understand
it. Auto generated documentation for properties do not provide any value at
all and the only effect it has is that it suppresses the diagnostic. This
defeats the purpose.
—
Reply to this email directly or view it on GitHub
https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/764#issuecomment-156075041
.

I have added a github project that documents properties and methods.
It seems to be working pretty well, for anyone that does want their documentation generated for those POCO classes.
https://github.com/jimmymain/Documentation.Analyzers
Regards
Craig.

Hi,
From the thread it looks like this hasn't been fixed. Would you accept fixes for this if I worked on it? This is an important CodeFix and I'd like to get it working
Cheers
Chris

Perhaps try my fix: it's had a few thousand downloads, nobody has ever added any suggestions or bugs, so give it a whirl, and let me know if anything can be improved.


AddExtraPath was broken by the rule change for import resolve errors

Because the 'rule' for diagnostics changed in order to pass around the loc key, we can no longer use this to support addExtraPath quick fixes.
The solution to this might be to not change the rule (as it's not really a rule anymore) or to fix addExtraPath to check for the new loc keys instead.

This issue has been fixed in prerelease version 2023.7.42, which we've just released. You can find the changelog here: CHANGELOG.md


chore: convert @fluid-experimental/property-properties to TS [ 2 / 3 ]

The goal of this PR is to introduce TS config to  @fluid-experimental/property-properties package.
This will allow gradual conversion.
@karlbom @nedalhy @DLehenbauer

LGTM


Remove useless eta expansion in bind notation.

What is the reason we are using the notation >> here? Why don't we use the more common notation >>=? Worse, this notation is confusing, in Haskell x >> y means bind x (fun _ => y) (for which we use the notation ;;).

Related to this, I cannot make sense of the @@ notation. It is also not used anywhere.

I removed the @@ and replaced >> with >>=,  as (rightfully) suggested.


[Bug] Vim mode + contenteditable doesn't show any caret if content is empty

Reproduce: go to https://codemirror.net/demo/vim.html and delete all content
Expectation: the fat caret is still shown at the first character position
Actual: no caret is shown
Note:

If inputStyle is "textarea" instead then the caret is shown even if content is empty
Related: https://github.com/codemirror/CodeMirror/issues/3552

Possibly related: #6312
When inputStyle is "contenteditable", the vim keymap displays the normal mode cursor (fat cursor) by using doc.markText to mark the current character. An empty line does not have any character, so the mark does not show up.


[add] Shell script & GitHub action for fetching PDF & transform Markdown

[add] Shell script & GitHub action for fetching PDF & transform Markdown (resolve #3)
[migrate] replace NPM with PNPM to enable Package Cache
[optimize] folder structure

@xycjscs

great work👍


Update test procedure based on ONC feedback.

This moves the OpenID Connect and Refresh Token tests within each of the launches test groups.  It also gets rid of the 'try two patients' test and related DB fields because we are just looking for the patient context on EHR launch now.

FYI @czh-orz -- please merge if it looks good to you.  Also, this touches a few files that you'll be editing when fixing the issue regarding launch / redirect URI not showing up in dev view, so you should make sure you build on top of this to avoid merge conflicts.

Thanks, fixed typos.  Anything else?


Adding Getting Started section to README

README Update
Please add a getting started section to the README so others will know how to start with this project.

Added a Getting Started section to the README file.


Account type based on first letter of random name

User story
As a developer
I can determine the type (Person, Org, Gov, Contract etc) using the first letter of the accounts name
so that I can quickly and efficiently find the data about that entity which is in different tables
Definition of done

[ ] The first letter of a random account name is fixed based on the account type

Person = p
Organization = o
Goverment = g
Smart contract = s

@Rebal67 during this task we should also remove the type struct member variable for the eosio table, as it is redundant. I have created a follow up task for this for the SDK here
https://app.zenhub.com/workspaces/tonomy-id-62a06b705d27820023023630/issues/tonomy-foundation/tonomy-id-sdk/40

Strict remove from table and creating an account and from unit test


Merge CB-10794 into master

Merges the fix for CB-10794 from the CB-2.37.0 branch to master. See original PR at #9890.

Okay I don't know why there are so many other commits in this PR. Is that expected? I created this PR my checking by creating it from an updated version of master, and running git merge CB-2.37.0.

Okay I don't know why there are so many other commits in this PR. Is that expected? I created this PR my checking by creating it from an updated version of master, and running git merge CB-2.37.0.

The previous merge from 2.37 was merged incorrectly and the commit ids changed.

The previous merge from 2.37 was merged incorrectly and the commit ids changed.


Make notebooks searchable

This enables text search in notebooks.
To accomplish this:

I converted the use of the deprecated WebView to the newer WKWebView.
The standard "Find" menu items were changed to send the preferred performTextFinderAction(_:) action.
ViewController was extended to serve as a NSTextFinderBarContainer and mediate between an NSTextFinder and the WKWebView.

Note that bugs in WebKit seem to prevent incremental search from working properly. I left incremental search disabled to avoid various fragile-seeming workarounds that are discussed around the web.

Thanks a lot for the PR. Nice work! I hope to go over your changes on the weekend.

Lgtm! I noticed that the actions to change text size (Cmd-+/-/0) were no longer working with WKWebView. I'll push a follow-up after merging this PR.


RDS: add database + username config

This adds some new optional input variables for the rds module:

database: the database name
username: the username used for auth

Both of these values are currently set in RDS using name, which is a nice default but not especially flexible. It puts a lot of stuttering into the DSN and can be a little verbose when your top-level identifier is namespaced already.
Using a name like lambda-warehouses leads to an output addr that looks like:
postgres://lambda-warehouses:<PASS>@<HOST>/lambda-warehouses

(note that <HOST> will also contain lambda-warehouses, making it appear a total of 3 times)
This PR allows something a bit more clean like:
postgres://segment:<PASS>@<HOST>/public

Admittedly, this is mostly aesthetic, but I don't think it's unreasonable to want to set this configuration yourself. (and perhaps there are non-aesthetic use-cases I'm just not thinking of)

Actually, just discovered that you can't use hyphens in DBName, unlike the Identifier where they are allowed. This PR actually enhances this module by allowing you to do that.

👍

Should the database/username variables have default values?

@achille-roussel we can totally add some defaults, just seems like it'd be really opinionated no matter what I chose.

Oh, and I didn't set defaults here to retain backwards-compatibility. (where var.name is used instead)

The problem is if there are no defaults the values are required to be set, I think we should just set empty strings as defaults.

Oh gotcha, I see what you mean now!

@achille-roussel done! (ie: added default = "" to both)

👍


Factory Upgrade Bug

Upon adding a factory installer, you have to break the machine before adding Speed/Energy upgrades. Otherwise, you will add them and they will not actually give the bonus, and you can not withdraw them. If you add them, you have to break it and place the machine again .. resulting in the upgrades disappearing.
TL;DR: You have to break the factory after installer upgrades it (Basic-->Elite-->Ult) before you are able to add speed/energy upgrades.
Edit: I am using version <IP_ADDRESS>

I experienced this too; however, the bug was fixed in version 2.571, so if you upgrade to the latest 8.3 release, you should be golden.


test_stripe: Normalize fixtures for test_stripe_billing_portal_urls.

This normalizes the fixtures generated by test_stripe_billing_portal_urls test to a great extent.
I think we can merge this checkpoint.

Merged, thanks @amanagr!


Packages don't follow SemVer

Describe the bug
I have "dockview": "^1.10.1" in my package.json, did an npm update, locked version got bumped from 1.10.1 to 1.17.1.
Since this is a minor version update, I would've expected backwards compatibility. But they are not, even the release notes talk about many breaking changes.
A specific error I got was that the PanelCollection<T> type doesn't exist anymore.
I have updated my code without a big hassle, but now I am afraid that more things have changed under the hood which are incompatible. I don't really want to / have the time to manually test everything now.
Expected behavior
Package follows SemVer, minor version updates are backwards compatible
...OR it is stated explicitly that the package does NOT follow SemVer, in which case I would change my package.json to only update the patch versions.
Additional context
I use a typescript based react project, originally created via create-react-app.

Apologies - before dockview 1.18.0-ish the library interfaces had been changing frequently as the library was standardized.
Now on version 3.0.0 dockview is following SemVer where breaking changes will only be released on major versions.


research impacts of TSC on rate limiter

The rate limiter and timer implementations may need to be aware of whether
tsc is enabled, and fall back to a more robust strategy if not.
Reference: http://btorpey.github.io/blog/2014/02/18/clock-sources-in-linux/
originally filed as https://github.com/engineblock/engineblock/issues/147

This is moot with the enhancements in 5.21.+


Adds a build script

Resolves #20.

There's now only one place where you have to update your version number after a release (Directory.Build.props). However, AppVeyor now no longer uses this number. I can change this back if you want.
The script can be executed locally with .\build.ps1 and you can use the parameters -RunBuild $true & -RunTests $true to e.g. not run tests etc.
AppVeyor runs this script as well so there's only one place where the build pipeline is defined.
AppVeyor sets a VersionSuffix if it is a regular commit/PR and it does NOT set it if it is a release (a git tag)

Just let me know if yo don't like something here!!

sorry - there's an issue with the appveyor script... I'll fix it...

I fixed the AppVeyor config.


TF 2.9 - CombinedNonMaxSuppression conversion to TFLite not working anymore

Click to expand!
Issue Type
Support
Source
binary
Tensorflow Version
tf 2.9
Custom Code
Yes
OS Platform and Distribution
Linux Ubuntu 20.04.4 LTS
Mobile device
No response
Python version
3.9
Bazel version
No response
GCC/Compiler version
No response
CUDA/cuDNN version
11.2/8.1
GPU model and memory
No response
Current Behaviour?
In tensorflow 2.8 the provided code didn't raise any error. In tensorflow 2.9 ERROR_NEEDS_FLEX_OPS is raised.

Standalone code to reproduce the issue
import tensorflow as tf

class NMSLayer(tf.keras.layers.Layer):

    def __init__(self, **kwargs):
        super().__init__(**kwargs)

    def call(self, inputs, **kwargs):
        boxes, scores = inputs[0], inputs[1]
        boxes, scores, classes, valid_detections = tf.image.combined_non_max_suppression(
            boxes=boxes,
            scores=scores,
            max_output_size_per_class=8,
            max_total_size=8,
            iou_threshold=0.5,
            score_threshold=0.5,
            pad_per_class=False,
            clip_boxes=True,
            name=f'{self.name}/NMS_op'
        )

        return boxes, scores, tf.cast(classes, dtype=tf.int32), valid_detections

def representative_dataset_generator():
    for batch in range(10):
        yield [tf.zeros((1, 10, 1, 4)), tf.zeros((1, 10, 5))]

num_boxes = 10
num_classes = 5

boxes = tf.keras.Input((num_boxes, 1, 4), batch_size=1)
scores = tf.keras.Input((num_boxes, num_classes))

model = tf.keras.Model([boxes, scores], NMSLayer()([boxes, scores]))
# test that the model can run
model(next(representative_dataset_generator()))

converter = tf.lite.TFLiteConverter.from_keras_model(model)
converter.optimizations = [tf.lite.Optimize.DEFAULT]
converter.target_spec.supported_ops = [
    tf.lite.OpsSet.SELECT_TF_OPS, tf.lite.OpsSet.TFLITE_BUILTINS_INT8
]
converter.representative_dataset = representative_dataset_generator
converter.target_spec.supported_types = [tf.int8]
converter.inference_input_type = tf.uint8
converter.inference_output_type = tf.uint8
tflite_model = converter.convert()

Relevant log output
Error code: ERROR_NEEDS_FLEX_OPS
<unknown>:0: error: failed while converting: 'main':
Some ops are not supported by the native TFLite runtime, you can enable TF kernels fallback using TF Select. See instructions: https://www.tensorflow.org/lite/guide/ops_select
TF Select ops: CombinedNonMaxSuppression
Details:
	tf.CombinedNonMaxSuppression(tensor<1x10x1x4xf32>, tensor<?x10x5xf32>, tensor<i32>, tensor<i32>, tensor<f32>, tensor<f32>) -> (tensor<1x8x4xf32>, tensor<1x8xf32>, tensor<1x8xf32>, tensor<1xi32>) : {clip_boxes = true, device = "", pad_per_class = false}

Hi @sachinprasadhs ! Could you please look at this issue ? It is replicating in 2.9 and nightly. Thank you!

Any updates on this?

Hi @rovinellimarco !
I was able to convert the model to a Tflite model  by skipping this line.
#converter.target_spec.supported_types = [tf.int8]
Attached resolved gist in nightly for reference.
Thank you!

As far as I know, that line is needed to have fully integer models so it is not an option to remove it.

Ok @rovinellimarco !
Actually original select ops issue was getting resolved with following syntax (skipping #converter.target_spec.supported_types = [tf.int8]
) before lite conversion and asking a 4D box tensor when not skipped.
converter.target_spec.supported_ops = [
    tf.lite.OpsSet.SELECT_TF_OPS, tf.lite.OpsSet.TFLITE_BUILTINS_INT8
]
converter.allow_custom_ops = True
converter.experimental_new_converter = True

Inference input and output type are not int8 types though . But they are int32 type, will that work for your use case.
Thank you!

It seems like the generated TFLite matches the result that I was getting on TF 2.8 so yes this solves the problem, thank you!