Python: Parsing openapi documents and creating skills with their operations

Motivation and Context

This allows us to import OpenAPI documents, including ChatGPT plugins, into the Semantic Kernel.
Description

Parse an OpenAPI document
For each operation in the document, create a function that will execute the operation
Add all those operations to a skill in the kernel
Modified import_skill to accept a dictionary of functions instead of just class so that we can import dynamically created functions

TODO:

Create unit tests

TESTING:
I've been testing this with the following ChatGPT plugins:

Semantic Kernel Starter's Python Flask plugin
ChatGPT's example retrieval plugin

This one was annoying to setup. I didn't get the plugin functioning, but I was able to send the right API requests

Google ChatGPT plugin
Chat TODO plugin

Then I used this python file to test the examples:
import asyncio
import logging

import semantic_kernel as sk
from semantic_kernel import ContextVariables, Kernel
from semantic_kernel.connectors.ai.open_ai import AzureTextCompletion
from semantic_kernel.connectors.openapi.sk_openapi import register_openapi_skill

# Example usage
chatgpt_retrieval_plugin = {
    "openapi": # location of the plugin's openapi.yaml file,
    "payload": {
        "queries": [
            {
                "query": "string",
                "filter": {
                    "document_id": "string",
                    "source": "email",
                    "source_id": "string",
                    "author": "string",
                    "start_date": "string",
                    "end_date": "string",
                },
                "top_k": 3,
            }
        ]
    },
    "operation_id": "query_query_post",
}

sk_python_flask = {
    "openapi":  # location of the plugin's openapi.yaml file,
    "path_params": {"skill_name": "FunSkill", "function_name": "Joke"},
    "payload": {"input": "dinosaurs"},
    "operation_id": "executeFunction",
}
google_chatgpt_plugin = {
    "openapi":  # location of the plugin's openapi.yaml file,
    "query_params": {"q": "dinosaurs"},
    "operation_id": "searchGet",
}

todo_plugin_add = {
    "openapi":  # location of the plugin's openapi.yaml file,
    "path_params": {"username": "markkarle"},
    "payload": {"todo": "finish this"},
    "operation_id": "addTodo",
}

todo_plugin_get = {
    "openapi":  # location of the plugin's openapi.yaml file,
    "path_params": {"username": "markkarle"},
    "operation_id": "getTodos",
}

todo_plugin_delete = {
    "openapi":  # location of the plugin's openapi.yaml file,
    "path_params": {"username": "markkarle"},
    "payload": {"todo_idx": 0},
    "operation_id": "deleteTodo",
}

plugin = todo_plugin_get # set this to the plugin you want to try

logger = logging.getLogger(__name__)
logger.addHandler(logging.StreamHandler())
logger.setLevel(logging.DEBUG)

kernel = Kernel(log=logger)
deployment, api_key, endpoint = sk.azure_openai_settings_from_dot_env()
kernel.add_text_completion_service(
    "dv", AzureTextCompletion(deployment, endpoint, api_key)
)

skill = register_openapi_skill(
    kernel=kernel, skill_name="test", openapi_document=plugin["openapi"]
)
context_variables = ContextVariables(variables=plugin)
result = asyncio.run(
    skill[plugin["operation_id"]].invoke_async(variables=context_variables)
)
print(result)

Contribution Checklist

[ ] The code builds clean without any errors or warnings
[ ] The PR follows the SK Contribution Guidelines and the pre-submission formatting script raises no violations
[ ] All unit tests pass, and I have added new tests where possible
[ ] I didn't break anyone :smile:

Note: closes https://github.com/microsoft/semantic-kernel/issues/1863

@mkarle Not blocking, but I'd like to see example usage in kernel-syntax-examples


Proper app icons and launch image for tvOS templates

Instructions and sizes are at: https://developer.apple.com/tvos/human-interface-guidelines/icons-and-images/. The layered app icon is a bit of a challenge.

Assets are ready. Where do you want me to add them?


seldon-cli attr --action apply doesnt pick up the attributes json file

upon executing the following command in the command line : -
seldon-cli attr --action apply --client-name univision --json attr.json
the following error occurs  -
Traceback (most recent call last):
File "/opt/conda/bin/seldon-cli", line 4, in
import('pkg_resources').run_script('seldon==2.1', 'seldon-cli')
File "/opt/conda/lib/python2.7/site-packages/setuptools-23.0.0-py2.7.egg/pkg_resources/init.py", line 719, in run_script
connecting to zookeeper-1:2181,zookeeper-2:2181,zookeeper-3:2181 [SUCCEEDED]
File "/opt/conda/lib/python2.7/site-packages/setuptools-23.0.0-py2.7.egg/pkg_resources/init.py", line 1504, in run_script
File "/opt/conda/lib/python2.7/site-packages/seldon-2.1-py2.7.egg/EGG-INFO/scripts/seldon-cli", line 5, in
seldon.cli.start_seldoncli()
File "/opt/conda/lib/python2.7/site-packages/seldon-2.1-py2.7.egg/seldon/cli/init.py", line 3, in start_seldoncli
cli_main.main()
File "/opt/conda/lib/python2.7/site-packages/seldon-2.1-py2.7.egg/seldon/cli/cli_main.py", line 355, in main
cmds[cmd](opts,command_data, command_args)
File "/opt/conda/lib/python2.7/site-packages/seldon-2.1-py2.7.egg/seldon/cli/cmd_attr.py", line 250, in cmd_attr
actions[action](command_data, opts)
File "/opt/conda/lib/python2.7/site-packages/seldon-2.1-py2.7.egg/seldon/cli/cmd_attr.py", line 210, in action_apply
store_json(command_data,opts)
File "/opt/conda/lib/python2.7/site-packages/seldon-2.1-py2.7.egg/seldon/cli/cmd_attr.py", line 106, in store_json
f = open(opts.json)
IOError: [Errno 2] No such file or directory: 'attr.json'
the attr.json is present in the working directory
Shreyass-MBP:univision_poc shreyassrinivasan$ pwd
/Users/shreyassrinivasan/seldon/univision_poc
Shreyass-MBP:univision_poc shreyassrinivasan$ ls
attr.json					syndication_report_20161215_to_20161223.csv
items.csv
Shreyass-MBP:univision_poc shreyassrinivasan$

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close.
/lifecycle stale


Added guide to utilize updated script

Rewritten script in python and updated guide to schedule running of script for both Linux and Windows

@dev-bon is it possible to add instructions to see logs? Just in case the script in cron fails for some reason.

Yes this had been added now.


BIGIP restart restnoded

Do you already have an issue opened with F5 support?
Github Issues are consistently monitored by F5 staff, but should be considered as best effort only and you should not expect to receive the same level of response as provided by F5 Support. Please open an case with F5 if this is a critical issue.
ISSUE TYPE

Bug Report

AS3 BUILD/ VERSION

3.8.1

BIGIP VERSION

14.1.0 Build 0.0.116

SUMMARY

I am using cURL to send API request for configuring BIGIP virtual server. I noticed that when there is a mistake in the body of cURL BIG IP restart restnoded. Here is the error message.

Broadcast message from<EMAIL_ADDRESS>(Thu 2019-02-14 06:26:45 PST):

logger[11819]: Re-starting restnoded

STEPS TO REPRODUCE

{
   "class": "AS3",
   "action": "deploy",
   "persist": true,
   "declaration": {
      "class": "ADC",
      "schemaVersion": "3.0.0",
      "id": "urn:uuid:33045210-3ab8-4636-9b2a-c98d22ab915d",
      "label": "Sample 1",
      "remark": "Simple HTTP application with RR pool",
      "Sample_01": {
         "class": "Tenant",
         "A1": {
            "class": "Application",
            "template": "http",
            "serviceMain": {
               "class": "Service_HTTP",
               "virtualAddresses": [
                  "<IP_ADDRESS>"
               ],
               "pool": "web_pool"
            },
            "web_pool": {
               "class": "Pool",
               "monitors": [
                  "http"
               ],
               "members": [{
                  "servicePort": 80,
                  "serverAddresses": [
                     "<IP_ADDRESS>",
                     "<IP_ADDRESS>"
                  ]
               }]
            }
         }
      }
   }
}

Here is my cURL call
curl -k -u $PASS -X POST https://{BIGIP-IPADDRESS}/mgmt/shared/appsvcs/declare -d sample.json
Right cURL syntax (I get expected behavior with this API call)
curl -k -u $PASS -X POST https://{BIGIP-IPADDRESS}/mgmt/shared/appsvcs/declare -d @sample.json

<!--- You can also paste gist.github.com links for larger files -->

##### EXPECTED RESULTS
<!--- What did you expect to happen when running the steps above? -->

BIGIP shouldn't start the restnoded

##### ACTUAL RESULTS
<!--- What actually happened?  -->

<!--- Paste verbatim command output between quotes below -->

Broadcast message from<EMAIL_ADDRESS>(Thu 2019-02-14 06:26:45 PST):
logger[11819]: Re-starting restnoded

Thank you for the bug report, we are now tracking the issue internally.

Tracked internally as 900, slated fix in 3.10

@luckymuk please see release 3.10 for the fix. Thanks!


Prepare 0.7.0 release

Unless we discover something really wrong, this will mark 0.7.0.

This change is

Review status: 0 of 2 files reviewed at latest revision, all discussions resolved.

Comments from Reviewable

Review status: 0 of 7 files reviewed at latest revision, all discussions resolved.

Comments from Reviewable


Classes not applied in FastBoot when environment=production

Running on ember 3.1.2, the addon works fine, except for when I build/serve my app with --environment=production, I noticed that route classes are not applied to the body tag on the fastboot rendered version of the page. Once the page is re-rendered on the clientside, the classes are added correctly.

@billdami can you try the latest version and tell me if you're still seeing the same issue?
Also, can you provide some sort of reproduction of this? Can you share a repo that has the issue? I've not been seeing this in any of the projects that I'm using ember-body-class with 🤔

@jeffjewiss I've just had a quick look and it's an interesting problem. Your issue has nothing to do with "building with environment production" so it's not strictly related to this issue, but I have been able to recreate it locally and have a fix for it.
Essentially the problem is that you have added a class to the body already with class="sans-serif" so it is causing some issues with the fastboot implementation. If you remove that from the index.html file it starts working again.
This is potentially something that we can write a test for and fix but if you want to fix it locally you can remove that class from your body tag and let Ember manage it 👍

@mansona thanks for looking into this! Sorry for creating noise on this ticket. I didn't realize it wasn't related or that having a class already on the body would cause a conflict.
I can confirm that removing the class from the body fixes my issue, thanks again!

@jeffjewiss I'm not entirely sure this counts as noise on the ticket 😂 It could possibly be the issue that @billdami was having but it seemed like something else.
If anyone wants to track this issue I have created a PR that has a failing fastboot test https://github.com/stonecircle/ember-body-class/pull/27

Just hit this when building an app using per page themes in fastboot. We set the theme class in the body on a specific route using ember-body-class. Serving via fastboot causes the class to be stripped out and then re-added creating a visible flicker.

@john-griffin is your application private? can I take a look?

I'm closing this since there was no response. I've also fixed a bug recently that is now tested 👍


Shutdown switching windows and mac

Hi,
First of all thanks for the plugin! I checked and see you stop the plugin if the OS is not mac. This is quite annoying for me since I have a macbook and windows desktop and have to re-enable the plugin every time I played on the desktop.
Might be an option to do the check around the notification send instead to fix this issue. I'm willing to make a PR if you agree with this solution.

Hey! Sorry missed this issue. I'm glad you enjoy the plugin!
I had actually started to implement this back in august but never submitted it. If you'd like to look at how I did mine, or try another solution you have I'd welcome any pr that solves the problem well!
Here's what I have. Note it's not been tested much and been a while. https://github.com/fatfingers23/mac-runelite-native-notifications/commit/586d92e291e662c4f355e3c0ee83b281e50543a6

Added this update in the above PR. You should now check if it's a Mac OS on notification instead of just turning off the plugin if not. Should also try to toggle tray notifications off so you can have notifications work seamlessly in both os


Daniel Riccardo's driver color data cant be fetched when plotting data

Describe the issue:
Since the driver lineup changed after the British GP, Daniel Riccardo should be added to the fastf1 data. It looks like his data is properly recorded on the data such as session.laps. However, when I try to fetch the color data of Daniel Riccardo, the code returns error shown below:
KeyError: 'RIC'
How can we fix this?
Reproduce the code example:
def lap_time_distribution(session):
    drivers = session.results.Abbreviation
    driver_laps = session.laps.pick_drivers(drivers).pick_quicklaps()
    driver_laps = driver_laps.reset_index()

    finishing_order = [session.get_driver(i).Abbreviation for i in drivers]

    driver_colors = {abv: fastf1.plotting.DRIVER_COLORS[driver] for abv, driver in fastf1.plotting.DRIVER_TRANSLATE.items()}

    # create the figure
    fig, ax = plt.subplots(figsize=(10, 5))

    # Seaborn doesn't have proper timedelta support
    # so we have to convert timedelta to float (in seconds)
    driver_laps["LapTime(s)"] = driver_laps["LapTime"].dt.total_seconds()

    sns.violinplot(data=driver_laps,
                x="Driver",
                y="LapTime(s)",
                inner=None,
                scale="area",
                order=finishing_order,
                palette=driver_colors
                )

    sns.swarmplot(data=driver_laps,
                x="Driver",
                y="LapTime(s)",
                order=finishing_order,
                hue="Compound",
                palette=fastf1.plotting.COMPOUND_COLORS,
                hue_order=["SOFT", "MEDIUM", "HARD"],
                linewidth=0,
                size=5,
                )

    ax.set_xlabel("Driver")
    ax.set_ylabel("Lap Time")
    sns.despine(left=True, bottom=True)

    ax.legend()
    plt.suptitle(f"Lap time distribution \n "f"{session.event['EventName']} {session.event.year} Race")
    plt.figure().set_size_inches(50000, 500000, forward=True)
    fig.set_dpi(1000)

    plt.show()

Error message:
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
Cell In[4], line 1
----> 1 lap_time_distribution(session)

Cell In[3], line 17, in lap_time_distribution(session)
     13 # Seaborn doesn't have proper timedelta support
     14 # so we have to convert timedelta to float (in seconds)
     15 driver_laps["LapTime(s)"] = driver_laps["LapTime"].dt.total_seconds()
---> 17 sns.violinplot(data=driver_laps,
     18             x="Driver",
     19             y="LapTime(s)",
     20             inner=None,
     21             scale="area",
     22             order=finishing_order,
     23             palette=driver_colors
     24             )
     26 sns.swarmplot(data=driver_laps,
     27             x="Driver",
     28             y="LapTime(s)",
   (...)
     34             size=5,
     35             )
     37 ax.set_xlabel("Driver")
...
--> 694         palette = [palette[l] for l in levels]
    696     colors = color_palette(palette, n_colors)
    698 # Desaturate a bit because these are patches

KeyError: 'RIC'

Added in #418 and released in 3.0.7, check that you have the newest version


registerWatchedPartials seems to have stopped working

Watched partial stopped working for me.  Not seeing any errors
...
    , hbs = require('hbs')
    , hbsutils = require('hbs-utils')(hbs)
...

hbsutils.registerWatchedPartials(__dirname + '/views/partials', {
    onchange : function(t) {
        logger.info(t + " changed!")             // not seeing this anymore
    },
    precompile : true
}, function() {
    logger.info("partials registered")          //see this
    hbs.registerHelper("debug", function(optionalValue) {
        logger.info("Current Context");
        logger.info("====================");
        logger.info(this);

        if (optionalValue) {
            logger.info("Value");
            logger.info("====================");
            logger.info(optionalValue);
        }
    });

    /*
     *  Special handlebars helper that allows you to pass parameters to a partial
     *
     * Usage:
     * <code>
     * {{include "partialName" param1="value" param2="value" ...}}
     * </code>
     */
    hbs.registerHelper('include', function(template, options) {
        // Find the partial in question.
        var partial = hbs.handlebars.partials[template];

        // Build the new context; if we don't include `this` we get functionality
        // similar to {% include ... with ... only %} in Django.
        var context = _.extend({}, this, options.hash);

        // Render, marked as safe so it isn't escaped.
        return new hbs.handlebars.SafeString(partial(context));
    });

    hbs.registerHelper('toString', function(value, varname) {
        var obj = {};
        if ( typeof (varname) === 'string') {
            obj[varname] = value;
        } else {
            obj = value;
        }
        return escape(JSON.stringify(obj));
    })
    /*
     * help method for formatting numbers to fixed decimal
     */
    hbs.registerHelper('fixed', function(decimals, value) {
        if (value.constructor === String) {
            value = parseFloat(value);
        }

        if ( typeof (value) !== 'number') {
            return 'NaN';
        }

        return value.toFixed(decimals);
    });
});

$ npm ls -depth=0
<EMAIL_ADDRESS>/Users/jeff.l/Documents/workspace/responsive-web-design/rwd
├──<EMAIL_ADDRESS>├──<EMAIL_ADDRESS>├──<EMAIL_ADDRESS>├──<EMAIL_ADDRESS>├──<EMAIL_ADDRESS>├──<EMAIL_ADDRESS>├──<EMAIL_ADDRESS>├──<EMAIL_ADDRESS>├──<EMAIL_ADDRESS>├──<EMAIL_ADDRESS>├──<EMAIL_ADDRESS>├──<EMAIL_ADDRESS>├──<EMAIL_ADDRESS>├──<EMAIL_ADDRESS>├──<EMAIL_ADDRESS>├──<EMAIL_ADDRESS>├──<EMAIL_ADDRESS>├──<EMAIL_ADDRESS>└──<EMAIL_ADDRESS>

In case this is relevant, I was using this in Docker with a mounted volume from a Windows host. It wasn't working, so I dug into it and found that the watcher is using node-watch, which wraps fs.watch, which doesn't work for NFS volumes. I'm guessing that docker-mounted volumes are NFS. I've swapped to another implementation of registerWatchedPartials that uses vinyl-fs.watch and this works: https://gist.github.com/jayfresh/fe8416ddce15b2c5038b

@jayfresh Thanks for the tip! It looks like vinyl-fs is using glob-watcher which is ultimately using gaze under the hood. If you want to try using gaze directly, I can look at moving the code over to that instead.

I haven's seen this issue in quite awhile.  Closing


Added support for binary payloads.

Payloads with a known binary Content-Type will be automatically
propagated to lambda with app.current_request.raw_body as a bytes-like
object. Responses which have a bytes body and a known binary Content-Type
header will be base64 encoded before being sent to API gateway, and API
gateway will correctly send the data depending on what Accept headers
were present on the request.
Implements #348
Example usage
app = Chalice(app_name='test-binary')

@app.route('/binary', methods=['POST'],
           content_types=['application/octet-stream'])
def binary_round_trip():
    return Response(
        app.current_request.raw_body,
        headers={
            'Content-Type': 'application/octet-stream'
        },
        status_code=200)

$ chalice deploy
.
.
.
$ test-binary echo -n -e '\xDE\xAD\xBE\xEF' | curl -s -H 'Accept: application/octet-stream' -H 'Content-Type: application/octet-stream' -X POST $(chalice url)binary --data-binary @- | xxd
0000000: dead beef                                ....
$ curl -s -H 'Accept: application/octet-stream' -H 'Content-Type: application/octet-stream' -X POST $(chalice url)binary --data-binary @image.png > round_tripped.png
$ diff image.png round_tripped.png
$

Still to do

Discuss and implement an interface for modifying which types are considered binary, as well as choose a small set of defaults. I picked a small number of defaults for my tests and nothing more.
Documentation

cc @jamesls @kyleknap

Codecov Report

Merging #352 into master will increase coverage by 0.15%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master     #352      +/-   ##
==========================================
+ Coverage   90.14%   90.29%   +0.15%
==========================================
  Files          18       18
  Lines        2039     2071      +32
  Branches      252      258       +6
==========================================
+ Hits         1838     1870      +32
  Misses        147      147
  Partials       54       54

Impacted Files
Coverage Δ

chalice/app.py
95.69% <100%> (+0.45%)
:arrow_up:

chalice/deploy/swagger.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 63fad06...2d5dceb. Read the comment docs.

I'm looking at this now, but high level question.  I think I'd prefer to move the docs out to the proper docs/ directory either under the 'views' topic or its own new topic.  The README is started to get pretty long and the tutorial stuff was intended to show case some of the key parts of the framework.
What do you all think?
cc @stealthycoin @kyleknap

@jamesls  +1 on moving this to a doc section.
While detailed README's are helpful, they are just a getting started document. When it starts getting overly detailed, people stop reading through it. Plus this in general should be in the documentation on read the docs and not only in the readme.

Sure I think I can move it to view.rst and maybe make a brief callout to the fact that binary is supported in the README under request content types/customizing the http response sections.

Cool, and also I'd suggest fleshing out the docs in more detail.  Now that it's in a separate topic guide, you can go into much more detail, show how to expand the list of binary values, maybe give more realistic examples (use an image or something), etc.

Yea sounds good to me, I was being overly concise due to it being in a "tutorial". I really need to describe the 6mb lambda limit as well.

Pushed a few changes, let me know if there's any feedback.

@stealthycoin Pushed a fix for the binary response validation (https://github.com/awslabs/chalice/pull/352/commits/6790b6cabe611a800087341ce837bb82812c6c7f)


Allow keeping CloudWatch log groups on destroy

Is your request related to a new offering from AWS?
No.
Is your request related to a problem? Please describe.
It'd be convenient to have the option to keep logs when the module (or container definition) is destroyed. This would be useful in cases where one has a compliance or regulatory requirement to keep logs for a certain amount of time.
Describe the solution you'd like.
Add an input variable - cloudwatch_logs_skip_destroy, similar to https://github.com/terraform-aws-modules/terraform-aws-lambda/commit/7256f7c226adf294bb6280f1fc4326d015e78d83
Describe alternatives you've considered.
n/a
Additional context
n/a

why?

It also sounds like a valid use case for the ECS module.

I disagree - and if I look back through the Lambda PR that added support, that is the exact issue that I would wish to avoid by always ensuring the log groups are deleted if the resources that use them are also destroyed https://github.com/terraform-aws-modules/terraform-aws-lambda/issues/563
If compliance is the issue - you would typically ship these off to a logging account (and into S3 for cost savings) where users do not have access to delete/modify

I agree, that we should always delete resources created by the module.
AFAIK, this flag was added in the Lambda module for cases where log groups may already exist, and we should use the existing log group. Lambda allows you to customize the log group names.
I may need to be corrected. Blame jetlag. :)

we do support using existing log groups, or log groups created outside of the module. But adding cloudwatch_logs_skip_destroy would intentionally leave log groups around after the resources are removed which will result in accruing charges and name conflict if you try to re-deploy the same resources again
and welcome back! boy am I glad this week is over, now time for some holiday R&R 😅

The lambda module supports existing log groups as well.
It's less of a convenience for ECS clusters, since one generally defines a lot fewer of those than Lambdas. I just noted that it was an option provided there and not here... 🤷
The added complexity probably isn't worth the trade-offs. Hopefully this issue will at least catch any other folks who come from that module looking for the flag.


Changing Imperial units doesn't seem to change anything

What happened?
Add a car, don't select imperial units initially
To Reproduce
Re-configure car to use imperial units after initially setting to not use imperial units
Expected behavior
Either by default after changing to imperial, or at least after a reload (fairly common thing to have to do in HA)/refresh of data, the units should change from KM to miles.
Deleting and re-adding with imperial selected (https://github.com/dan-r/HomeAssistant-NissanConnect/pull/60 to make it more obvious to others too!) did set the car up again with imperial units...
Log Output
Home Assistant Version
2024.10.3
Integration Version
v0.5.6
Additional context

Though it does seem to have confused some of the graphs a bit..

So the native unit of all measurements is metric, as this is what the Nissan API returns. By default, Home Assistant will convert the units and show in the unit for your locale/configuration.
The only reason this box exists is for countries like (maybe only) the UK who mostly use metric, except for a few exceptions like miles. As a result the only thing it changes is that is suggests to Home Assistant to use different units.
Because of this behaviour I may just remove the checkbox from the configure screen, but keep it on the initial setup screen. Even without this box you can click into each entity and change it manually and it'll convert everything for you.


Add SDL_ttf to hunter-packages

I would like to start working on SDL_ttf.
Could you create a fork of https://github.com/bminor/SDL_ttf ?

Done: https://github.com/hunter-packages/SDL_ttf


[CLOSED] Issue with compiling pattern guards.

 Issue by sweirich
Thursday Apr 26, 2018 at 16:59 GMT
Originally opened as https://github.com/antalsz/hs-to-coq/issues/85

With this definition from SmallStep.hs
exprIsTrivial' :: CoreExpr -> Bool
exprIsTrivial' (Tick _ e)               = exprIsTrivial' e
exprIsTrivial' (App e a) | isTypeArg a  = exprIsTrivial' e
exprIsTrivial' (Lam v e) | not (isId v) = exprIsTrivial' e
exprIsTrivial' (Cast e _)               = exprIsTrivial' e

exprIsTrivial' (Var _)      = True
exprIsTrivial' (Lit _)      = True
exprIsTrivial' (Coercion _) = True
exprIsTrivial' _ = False

I am getting this erroneous output (note toplevel match does not have the catchall branch):
Definition exprIsTrivial' : CoreSyn.CoreExpr -> bool :=
  fix exprIsTrivial' arg_0__
        := let j_2__ :=
             match arg_0__ with
             | CoreSyn.Cast e _ => exprIsTrivial' e
             | CoreSyn.Var _ => true
             | CoreSyn.Lit _ => true
             | CoreSyn.Coercion _ => true
             | _ => false
             end in
           match arg_0__ with
           | CoreSyn.Tick _ e => exprIsTrivial' e
           | CoreSyn.App e a =>
               if CoreSyn.isTypeArg a : bool then exprIsTrivial' e else
               j_2__
           | CoreSyn.Lam v e =>
               if negb (Var.isId v) : bool then exprIsTrivial' e else
               j_2__
           end.

 Comment by sweirich
Thursday Apr 26, 2018 at 17:08 GMT

Maybe this is the problem:
When looking up information about CoreSyn.Cast in constructorTypes
Could not find CoreSyn.h2ci in any of these directories:
Please either process CoreSyn first, or
skip declarations that mention CoreSyn.

where do I tell hs-to-coq where to look for h2ci files?

 Comment by sweirich
Thursday Apr 26, 2018 at 17:12 GMT

Yep, that was it.


Added Delivery Policy to the endpoint entity in the new API version

In this PR, we have

Upgraded the API version, 2017-10-12.
Added a new property  'Delivery Policy' on the endpoint property. Note that the design of this new property has already been approved by the ARM team.

Please refer to the earlier version 2017-04-02 of the swagger to compare the changes made in this PR.
This checklist is used to make sure that common issues in a pull request are addressed. This will expedite the process of getting your pull request merged and avoid extra work on your part to fix issues discovered during the review process.
PR information

[x] The title of the PR is clear and informative.
[x] There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For information on cleaning up the commits in your pull request, see this page.
[x] Except for special cases involving multiple contributors, the PR is started from a fork of the main repository, not a branch.
[x] If applicable, the PR references the bug/issue that it fixes.
[x] Swagger files are correctly named (e.g. the api-version in the path should match the api-version in the spec).

Quality of Swagger

[x] I have read the contribution guidelines.
[x] My spec meets the review criteria:

[x] The spec conforms to the Swagger 2.0 specification.
[x] The spec follows the guidelines described in the Swagger checklist document.
[x] Validation tools were run on swagger spec(s) and have all been fixed in this PR.

@jianghaolu what else needs to be done before this can be merged?

There are a number of errors in the examples. Please address. Thanks!


Server Crash with "this.fluidHandlerProvider"

Describe the Bug
We will start the server, but it crash instantly
Reproduction Steps
Start the server, crash will apear
Expected Result
Server will start normal
Screenshots and Videos
No response
Crash Report or Log
https://pastebin.com/JJ2X1cbJ
Operating System
Look in Crash Log
Mod Version
0.5.0i
Minecraft Version
1.19.2
Other Mods
No response
Additional Context
Please come with an resolve for this issue, our live server will not start anymore

Okey, i had deleted the Mechanical Pump with NBT Editor in the Chunk, now the server does load again

already fixed in dev


Update trace_link.py to merge Kineto trace with Pytorch execution trace.

This update modifies trace_link.py to incorporate GPU information from the Kineto trace into the PyTorch Execution trace. PyTorch's native execution trace offers insights into CPU operations but lacks GPU details. This enhancement ensures that both CPU and GPU information is captured, providing a more comprehensive view of execution for improved debugging and optimization.

@JoongunPark , Could you please provide commands to run trace_link.py with the provided datasets?

@JoongunPark  I understand that you want to connect the PyTorch profiler information with the Execution Trace.
These features to parse and analyze traces are actually availabe in HTA project, this was the reason i integrated Execution Trace into HTA, see here

https://github.com/facebookresearch/HolisticTraceAnalysis/blob/main/examples/execution_trace_demo.ipynb

These changes are fine but it would be good if we could use HTA for trace analysis. I don't want to prescribe since this is something you are working on but we do end up in duplicate code over time.

@briancoutinho, thank you for your input! I want to clarify that our modifications are specifically aimed at datasets collected over different time intervals from Kineto and Pytorch, a scenario that the current HTA does not appear to support as of now.
We are open to considering HTA for future datasets, but our current needs necessitate these specific features.

@JoongunPark I understand that you want to connect the PyTorch profiler information with the Execution Trace. These features to parse and analyze traces are actually availabe in HTA project, this was the reason i integrated Execution Trace into HTA, see here

https://github.com/facebookresearch/HolisticTraceAnalysis/blob/main/examples/execution_trace_demo.ipynb

These changes are fine but it would be good if we could use HTA for trace analysis. I don't want to prescribe since this is something you are working on but we do end up in duplicate code over time.

@briancoutinho - valid feedback. Like @JoongunPark already mentioned, HTA does not support this feature today.
We can and should align on HTA as the single solution for such analysis etc. Two things that could help:

Visibility - it would be great if you can help share the plans and roadmap etc.
Figure out a path to merging this feature into HTA and enable future development in HTA directly

Happy to get on a call to discuss this further.
cc: @louisfeng

@JoongunPark , Could you please provide commands to run trace_link.py with the provided datasets?

First, navigate to the param submodule where you'll find sample Pytorch-ET and Kineto input files and that handy merger script
$ cd extern/graph_frontend/param/train/compute/python/
$ pip3 install -r requirements.txt
$ pip3 install .
Second, unzip the input files
$ cd ./test/data
$ tar -xzf dlrm_kineto.tar.gz
$ tar -xzf dlrm_pytorch_et.tar.gz
$ cd ../../
 Please provide a full command sequence next time.
$ git clone --recurse-submodules git@github.com:facebookresearch/param.git
$ cd param
$ conda create -n param python=3.8.0
$ conda activate para
$ pip3 install -r requirements.txt
$ cd train/compute/python/
$ pip3 install .
$ pip3 install -r requirements.txt
$ cd test/data
$ tar -xzf dlrm_kineto.tar.gz
$ tar -xzf dlrm_pytorch_et.tar.gz
$ cd ../../

$ python3 ./tools/trace_link.py --et-file test/data/dlrm_pytorch_et/dlrm_eg_0.json --kineto-file test/data/dlrm_kineto/worker0* --exact-match --annotation 'enumerate(DataLoader)#_MultiProcessingDataLoaderIter.next'
$ python3 ./tools/trace_link.py --et-file test/data/dlrm_pytorch_et/dlrm_eg_1.json --kineto-file test/data/dlrm_kineto/worker1* --exact-match --annotation 'enumerate(DataLoader)#_MultiProcessingDataLoaderIter.next'
$ python3 ./tools/trace_link.py --et-file test/data/dlrm_pytorch_et/dlrm_eg_2.json --kineto-file test/data/dlrm_kineto/worker2* --exact-match --annotation 'enumerate(DataLoader)#_MultiProcessingDataLoaderIter.next'
$ python3 ./tools/trace_link.py --et-file test/data/dlrm_pytorch_et/dlrm_eg_3.json --kineto-file test/data/dlrm_kineto/worker3* --exact-match --annotation 'enumerate(DataLoader)#_MultiProcessingDataLoaderIter.next'
$ python3 ./tools/trace_link.py --et-file test/data/dlrm_pytorch_et/dlrm_eg_4.json --kineto-file test/data/dlrm_kineto/worker4* --exact-match --annotation 'enumerate(DataLoader)#_MultiProcessingDataLoaderIter.next'
$ python3 ./tools/trace_link.py --et-file test/data/dlrm_pytorch_et/dlrm_eg_5.json --kineto-file test/data/dlrm_kineto/worker5* --exact-match --annotation 'enumerate(DataLoader)#_MultiProcessingDataLoaderIter.next'
$ python3 ./tools/trace_link.py --et-file test/data/dlrm_pytorch_et/dlrm_eg_6.json --kineto-file test/data/dlrm_kineto/worker6* --exact-match --annotation 'enumerate(DataLoader)#_MultiProcessingDataLoaderIter.next'
$ python3 ./tools/trace_link.py --et-file test/data/dlrm_pytorch_et/dlrm_eg_7.json --kineto-file test/data/dlrm_kineto/worker7* --exact-match --annotation 'enumerate(DataLoader)#_MultiProcessingDataLoaderIter.next'

@briancoutinho, thank you for your input! I want to clarify that our modifications are specifically aimed at datasets collected over different time intervals from Kineto and Pytorch (which are also collected separately), a scenario that the current HTA does not appear to support as of now. We are open to considering HTA for future datasets, but our current needs necessitate these specific features.

Yep this makes sense, long term we do intend to support non overlap case as well in HTA. I was hitting some issues running the trace_link for some large traces (param is a git submodule in HTA so we do re-use your code :) ).
Let's sync up on the future direction in Charka WG

@briancoutinho, thank you for your input! I want to clarify that our modifications are specifically aimed at datasets collected over different time intervals from Kineto and Pytorch (which are also collected separately), a scenario that the current HTA does not appear to support as of now. We are open to considering HTA for future datasets, but our current needs necessitate these specific features.

Yep this makes sense, long term we do intend to support non overlap case as well in HTA. I was hitting some issues running the trace_link for some large traces (param is a git submodule in HTA so we do re-use your code :) ). Let's sync up on the future direction in Charka WG

@briancoutinho  can you accept this PR if this looks good? This is with the assumption we figure out a path to integration in HTA long term.

@srinivas212 sounds good to me:)


Infinite recursion in example

function get_event_dispatcher will call function get_producer to get an instance of Producer,
function get_event_dispatcher() {
    $dispatcher = new EventDispatcher;
    $dispatcher->addSubscriber(new EventListener\ErrorLogSubscriber);
    $dispatcher->addSubscriber(new EventListener\FailureSubscriber(get_producer()));
    return $dispatcher;
}

in order to generate instance producer function get_producer will call function get_event_dispatcher to generate an instance of EventDispatcher.
function get_producer() {
    return new Producer(get_queue_factory(), get_event_dispatcher());
}

This leads to infinite recursion when run example with any driver.

Thanks for reporting. Fixed in https://github.com/bernardphp/bernard/commit/c554419d7971c70055ae4c541f307dd2ec1fff01


[stacked] Add const constructors

Resolves #25.
Miscellaneous
I added a https://shields.io badge for the Pub version in order to be able to see the currently uploaded Pub version from the GitHub repo and also because it allows to go to the Pub package page with a single click. This way you can easily navigate from Pub to GitHub (using the "Repository (GitHub)" button) and now also the other way around.
Remove it if you think it should not be included.
Sidenote: I was wondering why the changelog uses headers to show changes. I followed it now because I am fine with doing so. However, I find it a bit hard to read the changelog when the text is so big that it spans across the entire screen.
I like the way the Flutter team does it. This has nothing to do with the PR; though, was just wondering 😅

Thanks man. I appreciate all of the efforts for some of the maintenance things.
I also like the way the Flutter team does it haha. I follow the template that's in the flutter create template that gets generated. But now that I look at it, it might be old and not a great way of doing things.
I will update all the packages in my break after hitting the gym. Will push the const update as well.


How to show Chinese

Can't do it right now, but happy to accept contributions to address this (if possible). Thanks 👍


Replace unmaintained Deis Workflow with Hephy's

Removed the old one, as the fork is the same, but better.

Thank's @victorberland!


JS SDK Revamp

Description of the change
JS SDK doc structure and content revamp
To Do

[x] Linking from other docs
[x] Accommodate clarifications from engg, collated details in this sheet
https://docs.google.com/spreadsheets/d/186eZVrOkkcRCvrV5t0HUM-pmEijUV4dJeXBDrPTRlQY/edit#gid=381665550

Closing this PR as the changes are migrated to this new PR


setScrollOffset does not behave correctly in Safari 10 with RTL

In Safari 10 (released on sept 20 of this year) it appears that Apple changed the way that scrollLeft values are calculated in RTL.
There is some ambiguous information in the safari change-log related to this issue, (search for "Right-to-Left " in the linked page). In addition, if you look at the jfiddle here you can see that the values of scrollLeft change based on what version you are on:
0 <-- 3500 (Safari 9.1.3)
-3500 <-- 0 (Safari 10)
This has resulted in setScrollOffset having unpredictable behavior in Safari 10. In previous versions of Safari (and in other browsers) using setScrollOffset to scrollWidth scrolls that component to its end, in Safari this is not the case.
JS Fiddle example: https://jsfiddle.net/uuphto47/25/

This issue is being closed as a preparation step before archiving the repository.  See the README for more detail.


.verifyCallback() does not work with es6 classes

Hello,
When calling the .execute() method on the recaptcha instance, the verifyCallback function is not called if within an es6 class. The verifyCallback is only called when outside the class. This is not ideal as it doesn't allow you to submit a form.
Doesn't work
import * as React from 'react';
import { RouteComponentProps } from 'react-router';
var Recaptcha = require('react-recaptcha');

export class Submit extends React.Component<RouteComponentProps<{}>, {}>{
    recaptchaInstance: any;
    constructor() {
        super();

        this.executeCaptcha = this.executeCaptcha.bind(this);
        this.verifyCallback = this.verifyCallback.bind(this);
    }

    executeCaptcha() {
        this.recaptchaInstance.execute();
    }

    verifyCallback(response){
        console.log(response); // never is called
        // submit form
    }

    render() {
        return

            <form onSubmit={this.executeCaptcha}>
                <button>Send</button>
            </form>
            <Recaptcha
                 ref={e => this.recaptchaInstance = e}
                 sitekey="xxxxxxxxxxxxxxxxxxxx"
                 size="invisible"
                 verifyCallback={this.verifyCallback}
            />

;
    }
}

It does work this way
import * as React from 'react';
import { RouteComponentProps } from 'react-router';
var Recaptcha = require('react-recaptcha');

const verifyCallback = function(response){
    console.log(response);
    // can't submit form now!? (or is there a way)
}

export class Submit extends React.Component<RouteComponentProps<{}>, {}>{
    recaptchaInstance: any;
    constructor() {
        super();

        this.executeCaptcha = this.executeCaptcha.bind(this);
        this.verifyCallback = this.verifyCallback.bind(this);
    }

    executeCaptcha() {
        this.recaptchaInstance.execute();
    }

    verifyCallback(response){
        console.log(response); // never is called
    }

    render() {
        return

            <form onSubmit={this.executeCaptcha}>
                <button>Send</button>
            </form>
            <Recaptcha
                 ref={e => this.recaptchaInstance = e}
                 sitekey="xxxxxxxxxxxxxxxxxxxx"
                 size="invisible"
                 verifyCallback={this.verifyCallback}
            />

;
    }
}

Is there a way we can stick the verifyCallback in the class?

workaround: pass any function to  onloadCallback
why:
https://github.com/appleboy/react-recaptcha/blob/52a22d896e556357517aa7078c33359346d1ed28/src/index.js#L69
if the component mount BEFORE the grecaptcha arrives, it would not call _renderGrecaptcha if render === 'explicit' && onloadCallback && this.state.ready && !prevState.ready is false.

I changed my key using this instruction
https://codelabs.developers.google.com/codelabs/reCAPTCHA/index.html#2
and verifyCallback began to work after execute.
Perhaps this will help someone.

@zhuangya workaround works, but only for 1 form submit. Even if a function is passed to onloadCallback, repeated form submit does not trigger verifyCallback.

@zhuangya The workaround doesn't work for me :( verifyCallback still does not execute.

Hey guys! As I encountered the same issue and couldn't solve it in a clean way I decided to create my own library. It has some improvements comparing to this lib and most important - it works completely fine! 🚀 Verify callback just works and what's awesome - you can have everything in your React component (not outside in some global variables).
Library: https://github.com/sarneeh/reaptcha
Example: https://sarneeh.github.io/reaptcha/
Hope it helps! 😄 🎉

@sarneeh Had this exact problem and this helped a bunch! Do you intend to continue to maintain it, for instance, after Google deprecate V2 for V3?

@thomasjthomasj As the library is very small and the functionality isn't a big deal I think I'll have time to maintain it for a longer period of time :) I'm "active" (not contributing much, but following things that happen) on GitHub, so I think it won't be a problem.
About reCAPTCHA v3 - I've actually thought about implementing it right away, but I've noticed that reCAPTCHA v3 is still in development and there might be major changes. So I've decided to leave it for now and when it will get stable - I will add support for it.


Swagger doc broken on version change

If the version number on the URI of a route is changed the swagger documentation is not generated for the older versions.

What do you mean? Currently the API_VERSION was created to manage the current API, if we decide to keep any old API we need to create another constant for that.
The swagger documentation is updated based on all routes/endpoints, so, we just need to add some route and the swagger will add whatever we've added.

That's exactly why I think keep version in the same app running is complete useless and have a lot of code duplication. So if I have v1 with 4 declared routes and v2 with 5 routes (4 from v1 and one new) I end up with 9 routes declared?! This is completely waste of effort to maintain a code base this way.

You didn't get yet.
Is important to keep the versioning by endpoint because sometime we need to generate a new features like:  /api/v1.2/whatever but keep the same feature available (some time) for old apps like: /api/v1.0/whatever.
If we release a new version without still support the old one, all apps that are using our app will break, doing that, we are making sure that our api clients will have time to update and migrate to the new api asap.
Doesn't make sense recreate a new server instance just to release a new API version, if we do that, we are not duplicating code, but duplicating projects.

You really don't get yet.
you have v1.0 (90 years old), you have v99.0 the most newer rock solid version. You have 0 calls to v1.0 in 5 years. You don't want to support any more this version and remove it. How you do it without generating a v99.1????? Their in the same codebase. There is no way to remove it without generating a new dummy version.
Imagine an v99.0 with 10 route. These routes were present in v98, but all of them have call signature modified. So just to this dummy case you end up with 20 different routes defined (each route have it's own handler and validator - as the signature changed). I think this is a big messy codebase.

by the way, this is just an enhancement issue. Not to be solved right away. It's an initial thought to take hapi-swagger to spin and try to solve its inability to handle in app versioning.

Ok, lets try step by step:
1 - I have that endpoint: /api/v1.0 that call the "WhateverController"
2 - I wanna change that endpoint adding a new feature, so I'm gonna implement it just creating a new controller called "WhateverControllerPlus" and I will reply this routes on: /api/v1.0.
3 - The old one: /api/v1.0 will be available for 1 month, after that, that support will be disable.
4 - And that's it, simple.
A lot of players like Google and Facebook works like that.

No no no no no, if you have modified you have to change the version. /api/v1.0 -> /api/v1.1.
Take this case:
1 - I have that endpoint: /api/v1.0 that call the "WhateverController"
2 - I wanna change that endpoint adding a new feature, so I'm gonna implement it just creating a new controller called "WhateverControllerPlus" and I will reply this routes on: /api/v1.1. Now we have these routes:
server.route({
method: 'GET',
path: '/api/v1.0/whatever',
config: {
handler:  controllers.WhateverController.doStuff,
validate: validators.AuthValidator.stuff,
description: 'This is whatever for v1.0',
tags: ['api']
}
});
server.route({
method: 'GET',
path: '/api/v1.1/whatever',
config: {
handler:  controllers.WhateverControllerPlus.doStuff,
validate: validators.AuthValidatorPlus.stuff,
description: 'This is whatever for v1.1',
tags: ['api']
}
});
3 - Now, keep going until v10, how many routes do you have now?

As I said, we're going to support the old api version just for some specific time, 01 month, 02 month, doesn't matter, after that time, will be removed.


ktera doesn't work please help

Be sure that you are using latest version. Autoupdate is not working in this beta, you need to download fresh version manually.

Casual_v<IP_ADDRESS>E

q,.q

That's strange, I've rechecked, it uses the same core and DB as latest shinra.

Make sure, that your damage is not filtered by options like "ignore oneshots" and "count only bosses"

Log file-----------
2016-05-09 00:22:04,581 [1] ERROR CasualMeter.App - System.Exception: Update.exe not found, not a Squirrel-installed app?
위치: Squirrel.UpdateManager.getUpdateExe() 파일 C:\Users\paulb\code\squirrel\squirrel.windows\src\Squirrel\UpdateManager.cs:줄 280
위치: Squirrel.UpdateManager.getApplicationName() 파일 C:\Users\paulb\code\squirrel\squirrel.windows\src\Squirrel\UpdateManager.cs:줄 259
위치: Squirrel.UpdateManager..ctor(String urlOrPath, String applicationName, String rootDirectory, IFileDownloader urlDownloader) 파일 C:\Users\paulb\code\squirrel\squirrel.windows\src\Squirrel\UpdateManager.cs:줄 41
위치: CasualMeter.App.d__3.MoveNext() 파일 J:\c\CasualMeter\CasualMeter\App.xaml.cs:줄 61
2016-05-09 00:22:04,911 [1] INFO  CasualMeter.App - Starting up.
2016-05-09 00:22:07,011 [6] INFO  CasualMeter.Common.UI.ViewModels.CasualViewModelBase - Sniffer has been enabled.
2016-05-09 00:23:23,375 [10] INFO  CasualMeter.Common.UI.ViewModels.CasualViewModelBase - Sniffer has been disabled.
2016-05-09 00:23:23,607 [10] INFO  CasualMeter.Common.UI.ViewModels.CasualViewModelBase - Sniffer has been enabled.
2016-05-09 00:23:30,055 [12] INFO  CasualMeter.Common.UI.ViewModels.CasualViewModelBase - Connected to server 벨릭의 은총.
2016-05-09 00:27:35,176 [1] INFO  CasualMeter.App - Closing.
2016-05-09 00:57:55,119 [1] ERROR CasualMeter.App - System.Exception: Update.exe not found, not a Squirrel-installed app?
위치: Squirrel.UpdateManager.getUpdateExe() 파일 C:\Users\paulb\code\squirrel\squirrel.windows\src\Squirrel\UpdateManager.cs:줄 280
위치: Squirrel.UpdateManager.getApplicationName() 파일 C:\Users\paulb\code\squirrel\squirrel.windows\src\Squirrel\UpdateManager.cs:줄 259
위치: Squirrel.UpdateManager..ctor(String urlOrPath, String applicationName, String rootDirectory, IFileDownloader urlDownloader) 파일 C:\Users\paulb\code\squirrel\squirrel.windows\src\Squirrel\UpdateManager.cs:줄 41
위치: CasualMeter.App.d__3.MoveNext() 파일 J:\c\CasualMeter\CasualMeter\App.xaml.cs:줄 61
2016-05-09 00:57:55,219 [1] INFO  CasualMeter.App - Starting up.
2016-05-09 00:57:56,443 [6] INFO  CasualMeter.Common.UI.ViewModels.CasualViewModelBase - Sniffer has been enabled.
2016-05-09 00:58:23,989 [8] INFO  CasualMeter.Common.UI.ViewModels.CasualViewModelBase - Connected to server 벨릭의 은총.

Error is from missing autoupdate files (seems I"ve compiled version with update check enabled), but next lines says that meter is successfully connected.
I can recompile it without update check, but that should not change anything.

Updated archive with autoupdate disabled version.

Q,.Q

Everything looks fine. Try to disable ignore oneshots filter. Shinra is working fine with this server now?

You have modded shinra, may be it using more fresh opcodes than you send us?

@Gl0 http://tera.nexon.com/main/index.aspx          / id<EMAIL_ADDRESS>   / pw:casual$
test Account~

I don't have KTera client, so it should take some time to get it

ok~

Try Casual_v<IP_ADDRESS>F.zip

thy thy thy~~~q,.q


Support sql.ErrNoRows

Since this is a model between the database and the application it would make sense for XO to add a flag option for adding for sql.ErrNoRows to models which return a single struct.
This is a relatively simple fix (using a marker in the Template) which changes
err = db.QueryRow(sqlstr, x).Scan(....)
if err != nil {
	return nil, err
}

Into this:
err = db.QueryRow(sqlstr, x).Scan(....)
if err != nil {

	// there was no row, but otherwise no error occurred
	if err == sql.ErrNoRows {
		return nil, nil
	}

	return nil, err
}

Then the application can just check that they get something back (if Foo != nil) rather than needing to add this additional check every place the model is used.

I understand the rationale, but I'm not sure if I agree if this is the logical behavior, as I don't think this would fit for all use cases. Part of what makes xo useful is that you're able to bring your own templates into the mix, and I think that this would be a perfect example of why you'd want to use custom templates.
As a side note, please note that you're basically dropping an error condition (or not reacting to it) and converting a specific error to nil. I don't think one could consider this idiomatic Go.

Excuse my laziness, but I'm just getting over a fever.
Edit https://github.com/knq/xo/blob/master/internal/argtype.go
// HandleNoRow and and return nil instead of an error for it
HandleNoRow bool `arg:"--handle-norow,help:return nil instead of an error if no record is found"`

And then in https://github.com/knq/xo/blob/master/templates/postgres.query.go.tpl#L19
if err != nil {
	{{- if .HandleNoRow }}
	if err == sql.ErrNoRows {
		return nil, nil
	}
	{{ end }}
	return nil, err
}

Thanks for the quick reply. Let me address your points:

I understand the rationale, but I'm not sure if I agree if this is the logical behavior, as I don't think this would fit for all use cases.

This wouldn't be the default behavior - but a highly useful small feature.

Part of what makes xo useful is that you're able to bring your own templates into the mix, and I think that this would be a perfect example of why you'd want to use custom templates.

It seems overkill to write your own templates just for this.

As a side note, please note that you're basically dropping an error condition (or not reacting to it) and converting a specific error to nil. I don't think one could consider this idiomatic Go.

It's not really an error condition. It's a marker you are supposed to check. No results is not treated as an error in any language but Go... which is why the recommend you check that everything is ok by using sql.ErrNoRows.
By allowing the check to be performed in the Model we can keep the code more DRY.

I understand, make sure your convinced this is a good feature (After several Go apps I am pretty convinced it is). Here is one more very common example of dealing with a user struct in different parts of the application.
user, err = models.GetUserByID/Email/Username(db, param)
if err != nil {
	if err == sql.ErrNoRows {
		user = nil
	} else {
		log.Fatal(err)
	}
}

vs
user, err = models.GetUserByID/Email/Username(db, param)
if err != nil {
	log.Fatal(err)
}

They both continue with the following user handling
if user == nil {
  // deny, login, redirect, 404
} else {

}

To me, keeping database-specific knowledge out of the controller also seem cleaner as every file I use a user object on, I shouldn't have to know (or import) the special sql constants to use my results.

I tend to agree that no rows returned from a specific query is not so much an exceptional error case and may occur often in cases where custom user criteria are allowed.  The case of returning nil allows the application to react to that case more naturally and separately handle a hard error such as the database not being available.
At the very least we should return a specific error type for the NoRows case if it is still going to return an error.

At the very least we should return a specific error type for the NoRows case if it is still going to return an error.

Returning an error marking an error marking a nil isn't exactly a step up. Then again, if your PHP/Java it's one more abstraction, so I guess that's a win.

I see your point and am definitely not one of those :)


[RFC] Existing Cluster Migration to/from Remote Store - HLD

Aim
To support migration of  existing  Doc Rep  cluster to/from Remote backed cluster which has Remote backed Segment , and Translog  enabled.
RFC :  https://github.com/opensearch-project/OpenSearch/issues/7986
Tenets

Data integrity - No data loss/corruption due to the migration process itself.
No  downtime for customer .

Writes as usual - There should be no impact to writes .
Reads - The behavior will switch from DocRep <-> Remote Store in between.

Migration should be possible via rolling restart or via Blue/Green mechanism.

Background & Terminology
Remote Store - https://opensearch.org/docs/latest/tuning-your-cluster/availability-and-recovery/remote-store/index/
Segment Replication - https://opensearch.org/docs/latest/tuning-your-cluster/availability-and-recovery/segment-replication/index/

Remote Store is enabled in a node via static settings from yml from 2.11 version onwards.
A cluster can have either all remote or all non-remote nodes.
On remote backed nodes, all the indices are remote enabled .
The only way to migrate  between docrep and remote store backed cluster is to restore snapshot into it.

What’s not supported/covered ?
Migration involving Segment Replication enabled indices w/o remote store is not currently scoped and will be considered as a follow up .
Pre Requisites

Cluster is migrated to 2.m  (the version which we support the migration) .
All indices are using document replication or the cluster is remote backed.

Approaches
https://github.com/opensearch-project/OpenSearch/issues/7986
Rolling restarts of the all the nodes
The migration process starts with updation of cluster settings to mixed mode with eventual direction as remote . This will be followed by rolling restarts of all the nodes.
DocRep to Remote Backed
Primary shard copies will be starting/relocating to remote-backed mode. Replica copy of a shard will only move to remote after primary copy movement. This will be ensured by the cluster manager. It will start operating in bilingual mode - indexing  documents in doc rep replicas, uploading segments/translog to remote storage and publishing checkpoints to remote replicas . Primary shard will use node attribute to find the state of each shard copy. Whenever the primary shard starts , it will need to turn on the bilingual mode.
As we restart each nodes, the new primaries followed by replica copies will start to operate in remote-backed mode. The primary will be indexing documents to older docrep replicas as well . When all the shards of an index has migrated to remote-backed mode, we will to update the index metadata to mark the index as a remote backed index .
We will need to add the direction of the migration in cluster setting . This will be used to determine the allocation of the new indices . This ensures our migration process always moves forward as it will not increase the migration work once started .
Using node attributes also helps in modelling the remote store migration like a version upgrade process where in once we migrate the shards to remote backed node, we are not moving it back to doc rep based node.
Remote Backed to DocRep
Replica shard copies will start relocating to docrep nodes. Primary copy of a shard will only move to docrep after all replica copy movement. This will be ensured by the cluster manager. Between this the primary shard on remote nodes operates in bilingual mode - indexing  documents in doc rep replicas, uploading segments/translog to remote storage and publishing checkpoints to remote replicas . Primary shard will use node attribute to find the state of each shard copy. Whenever the primary shard starts , it will need to turn on the bilingual mode.
User Story for docrep to remote migration

User needs to upgrade the version to 2.m (the version which we plan to support the migration) .
cluster.routing.allocation.balance.prefer_primary is enabled to balance out primary
Mode is set to mixed and set direction is set to docrep
Restart a node and then set direction is set to remote
Restart more nodes with remote store attributes in the yml one by one . Between restarts of the node, verify that shard relocation is complete.
When all nodes have been restarted , we need to switch the mode mode to strict. After this doc rep based nodes won’t be able to join the cluster

User Story for remote to docrep migration

User needs to upgrade the version to 2.m (the version which we plan to support the migration) .
Mode is set to mixed and set direction is set to remote
Restart a node and then set direction is set to docrep
Restart more nodes with remote store attributes one in the yml by one . Between restarts of the node, verify that shard relocation is complete.
When all nodes have been restarted , we need to switch the mode mode to strict. After this doc rep based nodes won’t be able to join the cluster

Lifecycle of primary and replica shards for DocRep to Remote

After we set direction to remote , new shards would only come up in remote mode .

Primary shards will get started/relocated on the remote  nodes . We will start  the primary  shard on remote node when remote store is in sync . The replica shards will only start on remote nodes, after primary shard has started on remote nodes.

New primaries come on remote node by primary relocation on indices

having replica in rolling restarts.
all indices in B/G

New primaries come on remote node by local recovery on indices having  no replica in rolling restarts  :  In local recovery , the writes can be blocked for long time , till the remote store is in complete sync . To mitigate this, it is advisable to have replica enabled for all indices.

After primary shard is migrated to remote , new replica copies will start/relocate in/to remote nodes as well . The new copy will take some time to come up as it has to download all the data afresh.  The read throughput can decrease during migration as all the replicas will need some time to come up .

Dual Mode :  When the primary shard has uploaded  . From now on , it persists data on RemoteStore.  But since it can have older replicas on docrep nodes, it will need to send over documents to those shards. This primary shard can only move to doc-rep mode, when it fails over and there is no remote shard available, but only a doc rep replica shard.

Updates Global Checkpoint -
Failover -
Primary Relocation -
Document Replicas - Receives documents , continues to update its own contents
Remote Backed Replicas - It will publish checkpoints to these .

Replica on node restart  :  If primary is remote , and the node is remote : Then the shard can hydrate from remote , as part of RemoteIndexRecovery

When all shards of index moves to remote backed, we can set the index settings to be remote enabled. We can reload the engines of all primary nodes to switch off dual mode as well. This needs a deeper thought though.

When all nodes have been restarted , we need to disable the migrating  mode to false.

Lifecycle of primary and replica shards for Remote to DocRep
The main difference is that primary shard will be last to move to docrep nodes. Unlike migration to remote store, migration back to docrep nodes will have no downtime

After we set direction to docrep , new shards would only come up in docrep mode .
Replica shards will get started/relocated on the docrep  nodes . The primary shards will only start on docrep nodes, after all replica shard have started on docrep nodes.

New primaries come on docrep node by primary relocation on indices having replica
New primaries come on remote node by local recovery on indices having  no replica in rolling restarts.

When primary is on remote node and replicas are on docrep nodes, Dual Mode keeps sending documents to those copies
When all shards of index moves to remote backed, we can remove the remote enabled. index settings .
When all nodes have been restarted , we need to disable the migrating  mode to false.

Components
Cluster Manager
Shard Allocation Deciders

Replica shards can only move to remote backed nodes after primary shard starts on remote backed node  .
Newly created as well as allocated primary and replica shards should be allocated only on  basis of direction (remote/docrep).

Primary Promotion

Once a primary shard moves to a remote node with all replicas still on doc rep nodes, its failures will lead to primary moving back to doc rep nodes. This should already be handled in PrimaryShardAllocator  . But we will need to verify it .
Once a primary shard is remote node with at least one replica on remote node,  we should promote only remote node as primary on failover .

Indexing
In mixed mode, when the primary is on remote-backed node, replicas can be on both remote and docrep nodes. In that case the primary needs to suppy documents to docrep nodes and publish checkpoints to remote nodes. We call this Dual Replication mode, where remote backed primary shard is able to take care of both docrep replicas and remote replicas. When all the shard copies of a give shard moves to remote-backed/docrep , the Dual Replication mode would  be turned off.
We need to evaluate on each action : the impact on remote primary , receivers (doc rep replica and remote replica) and remote primary receiving success/failure from the receiver for the duration of migration .  This would be covered in depth in Dual Replication LLD.
Reference : https://github.com/opensearch-project/OpenSearch/issues/5033
Primary - Primary Relocation
Doc Rep → Remote
The remote relocation will not complete all the data has been uploaded to remote in sync . The remote upload shouldn’t block writes .
Doc Rep → Doc Rep
Status Quo
Remote → Remote
We should relocate remote  primary shard to another remote node just like a remote backed shard . We need to make sure that the doc rep replicas continue to receive all documents from both of the replicas and doesn’t have any holes .
Remote → DocRep
We should relocate remote  primary shard to  doc node just like a docrep backed shard .
Failover
A primary shard  backed by remote store with at least one replica on remote node , the failover would be like a remote shard.
A primary shard  backed by remote store with all replicas on docrep , the shard will move back to docrep node.
If the shard is still migrating to remote store and the primary fails, the migration process will restart on a new remote node
Supporting References
https://github.com/opensearch-project/OpenSearch/issues/7986
Issues
[] https://github.com/opensearch-project/OpenSearch/issues/12245

Requesting feedback from @shwetathareja , @andrross , @mch2  , @ankitkala , @itiyamas .

Thanks for getting this going @gbbafna
A few thoughts...

What are the API calls a user makes? Restart a node and then set direction is set to remote Does a user do this or do we know already from config before restart?

In this flow we require node restarts and accept the read throughput impact.  Is there a hard requirement for the restart or is this for simplicity?  If so what is driving that?

If the shard is still migrating to remote store and the primary fails, the migration process will restart on a new remote node

I didn't quite follow this.  If we are migrating to remote store, and the DR primary fails, we would need to either select a DR replica (if still exists) or we risk data loss & choose a RS replica?


Merge 3-22 updates to live

OPS Build status updates of commit 053dada:
:white_check_mark: Validation status: passed

File
Status
Preview URL
Details

api/Access.Hyperlink.CreateNewDocument.md
:white_check_mark:Succeeded
View

api/Access.ListBox.md
:white_check_mark:Succeeded
View

api/Access.Module.ProcOfLine.md
:white_check_mark:Succeeded
View

api/Access.Module.ProcStartLine.md
:white_check_mark:Succeeded
View

api/Access.NavigationButton.Application.md
:white_check_mark:Succeeded
View

api/Access.NavigationButton.NavigationTargetName.md
:white_check_mark:Succeeded
View

api/Access.NavigationButton.NavigationWhereClause.md
:white_check_mark:Succeeded
View

api/Access.NavigationButton.ParentTab.md
:white_check_mark:Succeeded
View

api/Access.NavigationControl.Application.md
:white_check_mark:Succeeded
View

api/Access.NavigationControl.AutoTab.md
:white_check_mark:Succeeded
View

api/Access.NavigationControl.FilterLookup.md
:white_check_mark:Succeeded
View

api/Access.NavigationControl.LineSpacing.md
:white_check_mark:Succeeded
View

api/Access.NavigationControl.SelectedTab.md
:white_check_mark:Succeeded
View

api/Access.NavigationControl.Span.md
:white_check_mark:Succeeded
View

api/Access.NavigationControl.SubForm.md
:white_check_mark:Succeeded
View

api/Access.NavigationControl.Tabs.md
:white_check_mark:Succeeded
View

api/Access.ObjectFrame.Action.md
:white_check_mark:Succeeded
View

api/Access.ObjectFrame.Application.md
:white_check_mark:Succeeded
View

api/Access.ObjectFrame.AutoActivate.md
:white_check_mark:Succeeded
View

api/Access.ObjectFrame.DisplayType.md
:white_check_mark:Succeeded
View

api/Access.ObjectFrame.GridlineStyleBottom.md
:white_check_mark:Succeeded
View

api/Access.ObjectFrame.GridlineStyleLeft.md
:white_check_mark:Succeeded
View

api/Access.ObjectFrame.GridlineStyleRight.md
:white_check_mark:Succeeded
View

api/Access.ObjectFrame.GridlineStyleTop.md
:white_check_mark:Succeeded
View

api/Access.ObjectFrame.GridlineWidthBottom.md
:white_check_mark:Succeeded
View

api/Access.ObjectFrame.GridlineWidthLeft.md
:white_check_mark:Succeeded
View

api/Access.ObjectFrame.GridlineWidthRight.md
:white_check_mark:Succeeded
View

api/Access.ObjectFrame.GridlineWidthTop.md
:white_check_mark:Succeeded
View

api/Access.ObjectFrame.LinkChildFields.md
:white_check_mark:Succeeded
View

api/Access.ObjectFrame.LinkMasterFields.md
:white_check_mark:Succeeded
View

api/Access.ObjectFrame.OLEType.md
:white_check_mark:Succeeded
View

api/Access.ObjectFrame.OLETypeAllowed.md
:white_check_mark:Succeeded
View

api/Access.ObjectFrame.Scaling.md
:white_check_mark:Succeeded
View

api/Access.ObjectFrame.SizeMode.md
:white_check_mark:Succeeded
View

api/Access.ObjectFrame.SourceDoc.md
:white_check_mark:Succeeded
View

api/Access.ObjectFrame.SourceItem.md
:white_check_mark:Succeeded
View

api/Access.ObjectFrame.SourceObject.md
:white_check_mark:Succeeded
View

api/Access.ObjectFrame.UpdateMethod.md
:white_check_mark:Succeeded
View

api/Access.ObjectFrame.UpdateOptions.md
:white_check_mark:Succeeded
View

api/Access.Operation.Execute.md
:white_check_mark:Succeeded
View

api/Access.Operation.WSParameters.md
:white_check_mark:Succeeded
View

api/Access.OptionButton.Application.md
:white_check_mark:Succeeded
View

api/Access.Page.Application.md
:white_check_mark:Succeeded
View

api/Access.Page.PageIndex.md
:white_check_mark:Succeeded
View

api/Access.Page.SetTabOrder.md
:white_check_mark:Succeeded
View

api/Access.PageBreak.Application.md
:white_check_mark:Succeeded
View

api/Access.Pages.Add.md
:white_check_mark:Succeeded
View

api/Access.Pages.Remove.md
:white_check_mark:Succeeded
View

api/Access.Printer.ColorMode.md
:white_check_mark:Succeeded
View

api/Access.Printer.ColumnSpacing.md
:white_check_mark:Succeeded
View

This comment lists only the first 50 files in the pull request.
For more details, please refer to the build report.
Note: If you changed an existing file name or deleted a file, broken links in other files to the deleted or renamed file are listed only in the full build report.


what is TVM-xxxx in cveId field ?

Hello, first of all, the documentation is really well done, thanks for that.
However playing with the API (/api/machines/SoftwareVulnerabilitiesExport endpoint). I was surprised to see in one of the response:
{"Id":"41136cdbe088d0738b499d4d72575b9bfbb19c49_slack_slack_<IP_ADDRESS>_TVM-0001-00000000",
"DeviceName":"<REDACTED>",
"RbacGroupName":"UnassignedGroup",
"OSPlatform":"Windows11",
"OSVersion":"10.0.22621.2428",
"OSArchitecture":"x64",
"SoftwareVendor":"slack",
"SoftwareName":"slack",
"SoftwareVersion":"<IP_ADDRESS>",
"CveId":"TVM-0001-00000000",
"CvssScore":9
<SNIP>
}

This is not a CVE id which this field is supposed to be.
And there is no information at all about this in the documentation, so i'm bit confused.
So, please can someone explains this and update the documentation ?
Thanks a lot.
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

ID: 94b66855-e912-51da-b19c-e911a1dff358
Version Independent ID: 94b66855-e912-51da-b19c-e911a1dff358
Content: Export software vulnerabilities assessment per device
Content Source: microsoft-365/security/defender-endpoint/api/get-assessment-software-vulnerabilities.md
Service: microsoft-365-security
Sub-service: mde
GitHub Login: @Dansimp
Microsoft Alias: dansimp

Found here:
« A third-party vulnerability is retrieved only for vulnerabilities that do not have a CVE assigned to them. MS TVM can add a temporary name for the vulnerability, for example, TVM-XXXX-XXXX. This name is updated after a CVE ID is assigned. »


Interpret TDateTime as UTC (and not as local date/time)

Sometimes the date given to JsonDataObjects is in UTC already, for example when generated by functions such as EncodeDate(). When a local time offset is then subtracted internally by JsonDataObjects you can end up with a day earlier and some hours offset.
Maybe another property additionally to D[], such as DUtc[] would work, so you can intentionally set some dates as UTC and some as local time/date.
TJsonSerializationConfig.UseUtcTime is not enough, since TzSpecificLocalTimeToSystemTime() will be called regardless of that setting.
Thanks for the very well designed interface, btw!

Thanks.


Requesting support for WS unsubscriptions and orderly shutdowns

This issue is a request to provide clean effective ways to unsubscribe from websocket streams, and achieve an orderly shutdown of all the websocket connections.
Like the rest of us here, I'm building a cryptoxlib-based program that's designed to run 24/7. But in my case, I also need mechanisms to shut down my program without fear of corrupting my data or states.
I am recommending the creation of methods to (a) unsubscribe from one, some or all feeds at will, and (b) cleanly close one, some or all live websockets.
Would you folks consider scheduling something like this into your dev workflow, or would you prefer I have a crack myself and file a PR?
If you want me to do it, it might take a few weeks. In the meantime, I'll just add a signal mechanism into my app to tell it to disable websocket callbacks and flush out data, so it can cop a SIGKILL without risk of damage.
Keen for your thoughts

Hi @davidmcnabnz , actually unsubscription has been in the pipe for some time, I may look into it. Regarding the shutdown, can you be more specific what you would like to get?

Hi @nardew,
In the overall asyncio ecosystem, there are so many valuable frameworks on
offer. But with these frameworks, it's very common for them to be presented
to users in a pattern based on the assumption that the framework is the
only asyncio-based component in the program. With numerous frameworks, I've
had to deep-dive the code to figure out how to safely interoperate these
frameworks, without resorting to excessively unsafe hacks, and without
changing the framework code.
This issue also occurs in the cryptoxlib websockets interface For example,
client.compose_subscriptions([...])await client.start_websockets()
Admittedly, the 'start_websockets()' coro can be added to a list of tasks
that a program spawns before it makes its 'wait' call. But in this case,
the program can't shut itself down easily, because the cryptoxlib
websockets code assumes it will run forever until killed.
What I've done as a workaround is to create subclasses which allow for
orderly termination, by keeping refs to the underlying websockets, and
provide methods for closing them down in turn:
*class OurBinanceWebsocket(BinanceWebsocket):    def get_websocket(self) ->
Websocket:        ws = self._ws = self.get_full_websocket()        return
ws    async def close(self):        await self._ws.close()class
OurBinanceClient(BinanceClient):    def init(self, *args, **kw):
super().init(*args, **kw)        self.websockets = []    def
_get_websocket_mgr(self, subscriptions: List[Subscription],
startup_delay_ms: int = 0,                           ssl_context = None) ->
WebsocketMgr:        ws = OurBinanceWebsocket(subscriptions =
subscriptions, binance_client = self, api_key = self.api_key,
sec_key = self.sec_key, ssl_context = ssl_context)
this is what the subclass is needed for - keep a hold of websocket
instances        self.websockets.append((ws, subscriptions))        return
ws    async def closeWebsockets(self):        for ws in self.websockets:
await ws.close()*
The issue with the existing cryptoxlib websockets setup is that the
websocket objects are trafficked on the fly and not stored for future
access. Hence the above methods for storing them.
Cheers
David
On Wed, 28 Apr 2021 at 07:20, nardew @.***> wrote:

Hi @davidmcnabnz https://github.com/davidmcnabnz , actually
unsubscription has been in the pipe for some time, I may look into it.
Regarding the shutdown, can you be more specific what you would like to get?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/nardew/cryptoxlib-aio/issues/46#issuecomment-827855576,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ACZ6IFX5U37IPCJ4BTM4JYDTK4E6XANCNFSM43RYCVDA
.

Hi @davidmcnabnz , my question was more what API would suite your use-case because in all my projects the library is running in a never-ending loop and shutdown is managed by parent code (though not in the cleanest admittedly).
Anyway, in #47 I have implemented websocket unsubscription, re-subscription and clean shutdown, you can refer to examples/ws_subscriptions.py for examples. In the upcoming days I will merge the PR if I do not spot any issues.


FlutterActivity should extent AppCompatActivity instead of Activity

[Added by @matthew-carroll because there was no description]
FlutterActivity currently extends Activity. It should extend AppCompatActivity so that Flutter developers can leverage newer capabilities like Lifecycle and ViewModel.

AppCompatActivity is more powerful than activity, such as LifecycleOwner, ViewModelStoreOwner. It is more popular in Android projects.

Hi @beiger,
Is it proposal? Could you elaborate it more extendedly?
Thank you.

Yes, it's a proposal.
Sometimes, I need to use Android code to complete some Android specific functions, while the MVVM architecture commonly used by Android needs ViewModel, which requires the activity implements the viewmodelstoreowner interface.
For another example, I need to listen to the life cycle of an activity, which needs to implements the activity of the lifecycle owner interface.
What's more, the official attitude of the Android team is very clear. In the future, Android x will dominate. For example, if I want to use the dialogfragment of Android x, I need to the activity implements FragmentActivity from Android X.
Appcompatactivity can meet the above conditions.
So I hope that FlutterActivity or Flutter2Activity can extends AppCompatActivity.

Can't agree more...I was using embedding FlutterActivity and communicating with Native Libs which has been already published using FragmentActivity as there super activity... Now... I have to modify these libs to support android.app.Activity as there super activity , because FlutterActivity extends android.app.Acitivty...


Async client connect() method

Currently connect() method trashes the update thread. That makes handling multiple parallel connections troublesome. For example that may be done by separating calls to update() methods in two threads - first one handles the connecting clients and the second one handles send/recv updates. However I'm not sure how correct is it to handle all connect calls in one thread as latency was high when using single thread only (3-4s single thread vs 1-2ms two update threads). Overall it would be great if connect() was async too without all-time-polling connect-only handling thread that is always active in the profiler.
TcpConnection.java:77
			socket.connect(remoteAddress, timeout); // Connect using blocking mode for simplicity.

it postpones graceful shutdown

@MaXaMaR About your last comment: could a postponed graceful shutdown be a possible cause for the following issue? https://github.com/EsotericSoftware/kryonet/issues/142


Feat simulation driver

If you want to start from scratch, say so. We might do a better job now than continuing with this, but whatever.
This, along with #1 would close the following (please check if I missed something or included an issue that isn't completed before leaving a review):
#2
#5
#6
#8

Turning a valve off doesn't seem to affect the value picked up by the tag tracking that valve/address? It would make sense for it to be 0, but instead it's the value that's calculated (but not applied) for the valve in that tick.

The RTU at this point is just a proof of concept. We may want to rewrite if from scratch because the code is a bit messy. In fact, if we're doing an actual simulation (with the schematic and everything), then we should create all the tags beforehand (or create a configuration file) so that all the input and output tags are the same each time we test it (the TA told me this is what we should do if we're doing a proper simulation, and not just adding independent RNG generators for each tag).

2.2 Input tag on/off #5 doesn't seem like it's done?

I'll leave it out this PR, then.


Groups + Organisations search on case

Changes in this PR

Database View to enable searching of organisations and establishment groups all at once
Updates to autocomplete to enable hidden fields to send more data in forms
Updated create a case to search for groups and organisations
Refactored case organisation relationship to be polymorphic (Support::Organisation and Support::EstablishmentGroup)
Refactored case search to use a view (pg_search does not work with polymorphic relations FYI @d-a-v-e)

Screenshots of UI changes

 Add groups to the orgs search functionality in Case Management

Really like the JS tidy up @ryantk.
@d-a-v-e if we go with views and scenic we should have an ARD to record these choices.
@kennyevil you had thoughts on renaming some uses of organisation to establishment as we have a better understanding now of what we mean in different contexts; would this be an opportunity to incorporate that?
The organisation a case can be joined to and a person can be affiliated with is either an establishment or an establishment_group, I feel like we're not completely consistent yet.

@peterdavidhamilton @d-a-v-e Thanks for delving into this PR, it was quite far reaching for just a simple search box.


script tags not removed

I use a self-deployed prerender instance (phantomjs2 branch, current HEAD) internally for testing purposes. The server is configured with all the default settings and I enabled the following plugins:
server.use(prerender.removeScriptTags());
server.use(require('prerender-redis-cache'));

Pages are cached in redis with the expected HTML content but all <script> tags remain.
Pages proxied through the hosted service are rendered without <script> tags.

If I perform a diff of pages from my local redis and from the hosted prerender service the only difference is the presence of <script> tags (test page: https://www.freeletics.com/en/)
Did I miss something, or is that a regression?

Looks like a wrong assumption on my side, pages are actually served by the (nginx) prerender middleware without script tags, but nevertheless cached with the tags in redis.
If that's by design please let me know and I'll send a PR to add a note about it in the readme.

That was initially intended since the removeScriptTags plugin implements the beforeSend function but I think that could probably be changed to the afterPhantomRequest function to let you cache pages without the script tags so that they don't have to be removed every time the page is requested.

Thanks for the answer @thoop. I'm absolutely fine with keeping the tags in cache as long as the html is served without them. It might even be a good thing for people who decide to re-enable script tags, this way they don't have to render cached pages one more time.
I was just surprised to see them when I analyzed the content of my Redis db. Therefore I think this should be mentioned in the readme, a simple note is probably enough.
I'll send a PR


Side nav animation

Status
Type
Env Vars Change
Review App
Ticket

Hold
Feature
No
Link
Link

Description

Add animation to side nav.
Adjusted Layout for that.
Motivation and Context

Good feeling when using the side nav.

How Has This Been Tested?
locally

Screenshots / GIFs (if appropriate):

Version 1

Version 2

Version 3

Version 4

Types of changes

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

Checklist

[x] I have read the CONTRIBUTING document.
[ ] I have considered the accessibility of my changes (i.e. did I add proper content descriptions to images, or run my changes with talkback enabled?)
[x] I have documented my code if needed

Resolves

import { useDispatch, useSelector } from "react-redux";
import { setMenuStyle } from "../../redux/Actions/setting";

const MyComponent = () => {
  const dispatch = useDispatch();
  const menuStyle = useSelector((state) => state.setting.menuStyle);

  return (

{menuStyle}

      <Button
          onClick={() => {
            dispatch(setMenuStyle({ menuStyle: menuStyle === "default" ? "fancy" : "default" }));
          }}
        >

  )
}


Container Stuck in Creating State

Hello, after calling the ACICreate function, a container is successfully deployed and I can see it's status as running in the portal. I can check the ACIDetails storage table and see the entry for it being created is there as well. However, the status never changes from 'creating' to 'running' in the ACIDetails storage table as mentioned in the documentation. I've ran through all the steps a few times but can't seem to get this 'creating' status on a container to change. This causes nothing to be listed from the ACIList function, which in turn makes everything else not work properly. Do you happen to know why the status for this newly created container never changes from 'creating' to 'running'?
Thank you,
Brian

Issue resolved


Unexpected token ILLEGAL

/jsdom.js:55
throw new RangeError(`Invalid parsingMode option ${JSON.stringify(options.
^
SyntaxError: Unexpected token ILLEGAL
Are you kidding... Mate, at least run your soft before pushing...

Are you kidding... Mate, at least read the readme before whining. https://github.com/tmpvar/jsdom#install

I was updating from old version...

Ugh....

Yes, well, doing that without reading the changelog is a great recipe for disaster.

What disaster... It's not an nuclear reactor soft... You could have created new project if you move from node.js and leave only working version for node.js here.
Leaving no headache for the rest people.
Or at least make some check/test inside install procedure and abort/notify installation...
Think about others and fallbacks next time.
But thank you for contribution, sorry for my temper...

@Somebi I don't see any reason for the rant here. It's an open source project, all versions prior to 4.0.0 works with the node. You can always do:
npm install<EMAIL_ADDRESS>
Or fork this project and make it node-compatible.

npm install<EMAIL_ADDRESS>gives error for my project ? what's wrong?

@kamuran21 Most likely an error with Contextify.

:DD
On 12:11, Thu, Jul 30, 2015 Sebastian Mayr<EMAIL_ADDRESS>wrote:

@kamuran21 https://github.com/kamuran21 Most likely an error with
Contextify
https://github.com/tmpvar/jsdom/tree/39633c67c33f5ca9628a85f7c0df6a8a09595999#contextify
.
—
Reply to this email directly or view it on GitHub
https://github.com/tmpvar/jsdom/issues/1093#issuecomment-126235278.

This may be a stupid question but, if current versions of jsdom no longer runs on node, why is it installed via NPM?

npm is for io.js, node.js, browsers, bower, etc.
Look at the huge animated text on https://www.npmjs.com/

::npm emoji::

Also, io.js is going to be renamed to node.js eventually.
New language features are required if you want a fully complaint dom and html implementation. Currently, not even the bleeding edge of v8 is sufficient. Even a complete implementation of ES6 would not be sufficient (ES7 might be sufficient if things like weak references will be part of it). The only alternative for jsdom would be to add a native part that extends node.js or io.js

Domenic sorry mate, was too rush. More than a year have passed and you still working on this project. My deepest thanks. You are the true dev ;) Guess open source lives because of people like you. :)


[oslog] Fix bug where OSLog was not invalidating any state that it was changing.

This is important both for correctness reasons and for triaging reasons. The
correctness is obvious, but for those unaware there are many triaging utilities
that only verify or print pass output if the pass makes a change as indicated by
invalidating state.

@swift-ci smoke test


Create LICENSE

@maektwain Need your input on what license we want to add here. I have added the MIT license but we can change that. Aligning with Netlify Open Source's terms only the licenses listed here are allowed. Please let me know which one we want

Netlify

What is the issue are we addressing here, since this is license free or not , I am not sure that if this is the case , let me know maybe we can use some general license , MIT license is little strict !

@pulkitvyas08  @PulkitVyasCynsar
perhaps The Creative Commons Attribution-ShareAlike 4.0 International Public License (Creative Commons — Attribution-ShareAlike 4.0 International — CC BY-SA 4.0) for all content hosted on Second Exchange. Until MF license is released.
u might wanna add this definition in Foundation's open source policy also.
https://docs.muellners.info/open-source-policies/open-source-usage-and-delivery-policies

@pulkitvyas08 @PulkitVyasCynsar perhaps The Creative Commons Attribution-ShareAlike 4.0 International Public License (Creative Commons — Attribution-ShareAlike 4.0 International — CC BY-SA 4.0) for all content hosted on Second Exchange. Until MF license is released. u might wanna add this definition in Foundation's open source policy also. https://docs.muellners.info/open-source-policies/open-source-usage-and-delivery-policies

Okay I'll look into this. Thanks!


**Chat Page -- Fix issue on chats page (ref 1)

This issue happens when you are zoomed in, not sure it's something I need to address.


Conflict between pinchzoom and a simple tab event in draw mode

I noticed a problem on phone and tablet, there is a confusion between the end of pinchzoom, it draws a new point as if there was a touchdown, it is possible to notice this at this example http://openlayers.org/en/latest/examples/draw-features.html in case of a polygon.

While not a huge problem, I agree that this is visually disturbing.
Probably the Draw interaction should not render a cursor circle on movestart. Is anyone willing and able to provide a pull request?


Fetching of data in Data Editor takes unnecessary long

Hi all,
I'm using DBeaver 3.7.2 on Win7 64bit accessing Redshift using the RedshiftJDBC-<IP_ADDRESS>0.jar driver.
Double clicking on a table and then going in the Data tab (the Data Editor), reports that the first X number of rows (configured to 200) are fetched in a reasonable amount of time. However, after that, the progress bar keeps staying up, with no results shown, for an unreasonably long amount of time (depending on table size)
The expected behavior is for the results to be displayed as soon as the first X number of rows are fetched. Instead, the progress stays up for some extended amount of time AFTER the requested results have been reported as fetched by the progress bar.
This behaves exactly as an older bug appearing on SQL Server and Vertica, and solved here:
http://dbeaver.jkiss.org/forum/viewtopic.php?f=2&t=1693

Query manager shows '"Read Data' as the only active query, during that unexplained long waiting period.
Looking at Redshift's query manager on AWS Console, I see a query of 'select * from my_table' being active throughout the period that dbeaver shows the progress bar.
I experimented with increasing the 'number of rows fetched' setting to a very small value (still unreasonably slow) and to a very large value (query then takes really long time and it does seem that the data of all the requested rows are actually fetched from the server).

In my Preferences/Result Sets, I played with

'Use SQL to limit fetch size' (turning it on or off does not change anything. Interestingly the submitted query is identical)
'Use fetch size': ditto -- no change

I am also wondering whether the trick of limiting the cursor fetch size, as reported by @serge-rider  at Fri Apr 10, 2015 9:49 pm at the above mentioned forum, does not work on Redshift.
Kind regards and thanks in advance :)

I think this is a duplicate of  #725 (check it for workaround).
RedShift driver config will be fixed in the next version.

Looks like it. Thanks.
I'll use the generic PostgreSQL (Generic) driver and will wait for Dbeaver v3.7.5
Cheers


Installing Scrcpy in a Pixelbook Go

[ y] I have read the FAQ.
[ y] I have searched in existing issues.

Environment

OS: [Chromebook / Debian]
scrcpy version: [1.16]
installation method: [snap]
device model: Laptop: Pixelbook Go; Phone: Xiaomi K20 Pro
Android version: [10]

Describe the bug
It seems I could not use scrcpy due to this error.
jamaguilera@penguin:~$ scrcpy
INFO: scrcpy 1.16 <https://github.com/Genymobile/scrcpy>
ERROR: '/usr/local/share/scrcpy/scrcpy-server' does not exist or is not a regular file

I have tried to install scrcpy via snap because the normal mode gives me this error:
jamaguilera@penguin:~$ sudo apt install scrcpy
Reading package lists... Done
Building dependency tree
Reading state information... Done

No apt package "scrcpy", but there is a snap with that name.
Try "snap install scrcpy"

E: Unable to locate package scrcpy

Thanks in advance for anyone who could help!

same issue

'/usr/local/share/scrcpy/scrcpy-server' does not exist or is not a regular file

Does this file exist somewhere else (/usr/share/scrcpy/scrcpy-server) on your machine?
cc @sisco311

it does not show anywhere

I don't know where it has been installed then. Does it work if you build manually?
As a workaround, you could download the prebuilt server somewhere, and set its full path (filename including) in the environment variable SCRCPY_SERVER_PATH.
For example:
export SCRCPY_SERVER_PATH=/home/$USER/Downloads/scrcpy-server-v1.16
scrcpy

hello rom1v, good day.
I just did and it get me this error:
~~
-bash: export: `/usr/local/share/scrcpy/scrcpy-server/=/home/jamaguilera/scrcpy-server-v1.16': not a valid identifier
~~
apologies about this mess I'm really new to trying linux / chromebook. Thank you in advance

You must execute:
export SCRCPY_SERVER_PATH=/home/jamaguilera/scrcpy-server-v1.16


[WIP] V2 HdrHistogram Log format (v1.3)

This is a draft PR to kick off V2 HdrHistogram Log format support on the go version.
I've followed the wiki available at https://github.com/HdrHistogram/HdrHistogram.NET/wiki/V2-Log-Encoding and revised the python and java implementations.
Up until now we're able to parse test/jHiccup-2.0.7S.logV2.hlog and /test/tagged-Log.logV2.hlog.
IMHO, we need:

deeper testing
Examples of using the log readers and writers
Better error handing, conditional checks, and a linter pass to double check all errors are handled.

(This is based on cursory reading). I think the zigzag decide and encode may be wrong, V2 uses a ZigZag-encoded LEB128-64b9B-variant that differs from the original LEB128 used in e.g. google protocol buffers. The difference us subtle: an intentional lack of a termination but in the last byte, which reduces the maximum encoding length of a 64 bit value from 10 bytes to 9. The current code looks like it may be for the more generic 64b10 case. The loop termination in the current code may fail to terminate on some values (high bit of highest byte set).
In addition, the reason for the “ugly” deeply nested ifs (rather than using a loop with termination conditions) in the Java implementation is speed: the whole point in these encodings is that the vast majority of values are encoded in a small number (usually 1) of bytes, the non-loop forms tend to compile into faster code for these common cases (on most optimizing compilers) with real benefits in e.g. deciding speed,

@giltene @ahothan I've revised all change requests. I believe we're good for a new review :)


a new magento2 react-native project

this project can same with the following？
https://codecanyon.net/item/complete-react-native-app-for-magento2-ecommerce-websites/22174264

@benyang2015 no, it is different.


Evaluate summarizer frequency and triggers

See https://github.com/microsoft/FluidFramework/issues/9637#event-6320124651
Based on insights from the telemetry added in the aforementioned issue:

adjust the frequency of summaries, as we might be summarizing too often when we do not need to
decide if "idle" & "maxTime" triggers should fire

Currently fluid's definition of idle doesn't allow (at least to my knowledge) the application to provide extra hints of when it's really idle. It would be nice, for example, if Whiteboard could let fluid know when the user is in the middle of drawing a stroke, and hint that is a bad time to take the summary. This could be in the form of fluid calling into the app to ask if it's a good time (maybe in the form of an async method that completes when it is a good time?), or the app calling into fluid to inform it of when its either busy of idle. Fluid could then follow the app's hints unless it reaches some higher threshold of being too far behind.

https://dev.azure.com/fluidframework/internal/_workitems/edit/518/