[SPARK-46363][CORE][SQL] Improve the java text block with java15 feature.

What changes were proposed in this pull request?
Now, Spark upgraded to Java17 which contains many new feature. The text block is a feature released in Java15.
When using text blocks, the code looks more concise.
For example,
String timeError = "Time must be specified as seconds (s), " +
   "milliseconds (ms), microseconds (us), minutes (m or min), hour (h), or day (d). " +
   "E.g. 50s, 100ms, or 250us.";

Can be changed to.
String timeError = """
   Time must be specified as seconds (s), milliseconds (ms), microseconds (us), \
   minutes (m or min), hour (h), or day (d). E.g. 50s, 100ms, or 250us.""";

This PR is a initial one used for discussion and decision-making.
Shall we improve and simplify the long string with  java15 text block?
Why are the changes needed?
Using JEP 378: Text Blocks can bring the following benefits:

Simplify the task of writing Java programs by making it easy to express strings that span several lines of source code, while avoiding escape sequences in common cases.
Enhance the readability of strings in Java programs that denote code written in non-Java languages.
Support migration from string literals by stipulating that any new construct can express the same set of strings as a string literal, interpret the same escape sequences, and be manipulated in the same ways as a string literal.
Add escape sequences for managing explicit white space and newline control.

Does this PR introduce any user-facing change?
'No'.
How was this patch tested?
GA.
Was this patch authored or co-authored using generative AI tooling?
'No'.

@dongjoon-hyun @srowen @LuciferYang What are your suggestions?

cc @MaxGekk

fine to me, I think we should push it forward. @beliefer

Based on the suggestion from @cloud-fan, I close this PR. I will reopen this PR if need.


Fix lc823450

Summary

arch: lc823450: Fix compile errors in lc823450_usbdev.c with CONFIG_USBDEV_DMA=y
boards: lc823450-xgevk: Add CONFIG_USBDEV_DMA=y to rndis/defconfig

Impact

lc823450-xgevk:rndis only

Testing

Tested with ping, telnet

@acassis
I fixed the file.

Thank you, these kind of typo are hard to fine, I found it while search for an incorrect kmm_alloc instead of kmm_malloc


Support for circe with Scala 3

private val version = "3.1.2"
lazy val `sttp-circe` = "com.softwaremill.sttp.client3" % "circe_2.13" % version

results into
[error]   Not found
[error]   not found: /Users/bilal/.ivy2/local/com.softwaremill.sttp.client3/circe_3.0.0-M3/3.1.2/ivys/ivy.xml
[error]   not found: https://repo1.maven.org/maven2/com/softwaremill/sttp/client3/circe_3.0.0-M3/3.1.2/circe_3.0.0-M3-3.1.2.pom
[error]   not found: https://jcenter.bintray.com/com/softwaremill/sttp/client3/circe_3.0.0-M3/3.1.2/circe_3.0.0-M3-3.1.2.pom
[error] (ssExtractDependencies) sbt.librarymanagement.ResolveException: Error downloading com.softwaremill.sttp.client3:circe_3.0.0-M3:3.1.2
[error]   Not found

Only circe 0.14.0-M3 is published for scala3, and there are some incompatible changes:
[error] -- Error: sttp/json/circe/src/test/scala/sttp/client3/circe/CirceTests.scala:17:37
[error] 17 |    val req = basicRequest.body(body)
[error]    |                                     ^
[error]    |no implicit argument of type sttp.client3.BodySerializer[CirceTests.this.Outer] was found for an implicit parameter of method body in trait RequestTExtensions.
[error]    |I found:
[error]    |
[error]    |    sttp.client3.circe.circeBodySerializer[CirceTests.this.Outer](this.Outer.encoder
[error]    |      ,
[error]    |    /* missing */summon[io.circe.Printer])
[error]    |
[error]    |But no implicit values were found that match type io.circe.Printer.

so I suppose I'll have to wait until 0.14 to release for scala3 (and scala2 alike)

We could do separate sources, but now after upgrading to Scala3-RC1, circe isn't published yet

I guess it's worth waiting. Thanks 👍

0.14.0-M4 is out now, with 3.0.0-RC1 support.

The error seems to come from default implicit arguments here:
implicit def circeBodySerializer[B](implicit
      encoder: Encoder[B],
      printer: Printer = Printer.noSpaces
  ): BodySerializer[B]

anybody knows if this changed somehow in Scala3? The 3-RC1 compiler can't find the printer implicit, though it has a default value

I fought a nit with that as well, without getting anywhere.
I couldn't find a relevant changelog or reproduce it in a smaller example.

Hah, I was just preparing to commit a workaround for this. :D

Was it the same workaround? :)

Yep. I filed a bug in the dotty repo as well, but it's not really easy to create a minimal reproduction of it.

Ah, good that you let the dotty team know. Thanks! :)

Released in 3.1.5


Prevent Holodeck from loading outdated binaries

We are shipping changes that break compatibility with the old binaries (renaming the PixelCamera to RGBCamera, etc). If the holodeck package is updated without updating the binaries, users will get strange exceptions when creating worlds and the cause isn't immediately obvious.
We should check the installed package version against a minimum version specified in the holodeck package and abort with a message telling the user to update.

Fixed in #188


Auto-unseal and irsa support for vault addon

There is a chicken or egg problem of needing the kms key info in order to create a custom vault config to pass to helm, but if the key is created outside of the module, and we try to base count off the existence of the arn string we end up with the "terraform cannot predict how many instances will be created" issue.  There is probably a better way to handle this, but I have not been able to piece it together.
This will also require changes to how this addon is called from aws-ia/terraform-aws-eks-blueprints.

Is this feature able to get merged? I’d be tempted to play with it

It works for me, I haven’t heard a comment about getting it committed.
Here is the repo
here is one with needed EKS blueprints changes

Hey @mleklund thank you for contributing this - we had to carry out some other work before we could get to this, hence the delay.
The good news is that the other work is now done.
Could I get you to resolve the conflicting files so we can push this PR forward?

I saw the message and took a quick look at it but it does not look like a simple merge.  I am pretty tied up with work at the moment, and will have to loop back to this sometime later.

is there any update on this?

is there any update on this?

I have been tied up at with work and family and have not done anything since a quick look to see if it was an easy merge.  It did not look to be a quick easy merge due to upstream changes made after I submitted the merge request in June.  I probably wont have time to look at it for a couple of weeks at least, if anyone else wants to pick it up, feel free.

is there any update on this?

I have been tied up at with work and family and have not done anything since a quick look to see if it was an easy merge. It did not look to be a quick easy merge due to upstream changes made after I submitted the merge request in June. I probably wont have time to look at it for a couple of weeks at least, if anyone else wants to pick it up, feel free.

Yeah I understand the holidays is a difficult time to multitask. There is a rebased code repository in the branch https://github.com/mleklund/terraform-aws-eks-blueprints/tree/vault_auto_unseal I think this one would be easier to integrate because there are only 9 commits difference.

closing this as #11 is cleaner and better thought out then what I did here.


Versionbot: VB does bizarre things if the PR has a prerelease version bump

In https://github.com/resin-io-modules/resin-device-init/pull/25, the PR contained a version bump already (from 4.0.1 to 4.1.0-rc1), because I've been testing it integrated downstream before merging, and I needed a prerelease version with which to do so.
I probably should've remembered to remove this before merging, but it'd be nice if I didn't have to, or if VB complained up front. Instead, VB created a commit for the previous version number (v4.0.1), which did change the files to the right version (4.1.0), but put the changelog entry underneath the latest version number, bizarrely. VB's commit is here: https://github.com/resin-io-modules/resin-device-init/pull/25/commits/65b17f797aad6685364e7b2c8c5cccfc59557368. It then merged the PR, but failed to tag it, because it tried to tag with the old version that already exists.
This is a messy case and it'd be fine if VB rejected it, but it's a bit awkward that VB has instead merrily merged it, done some odd things en route, and left master in a broken state.

put the changelog entry underneath the latest version number, bizarrely

That part is because your Changelog's header doesn't adhere to the standard header which means the default value here skipped too many lines, and thought the ## v4.0.1 - 2017-11-21 was simply part of the header.
@jhermsmeier encountered the same thing on one of the Etcher-related module repos a while ago ;-)

@lurch true. I thought that'd been fixed, but clearly not. Good spot, thanks!
I think the issue with the wrong version tag being used is separate, and still remains, but I'll get this sorted too.


[Improve][Connector-V2] Support user-defined schema for reading text file

Purpose of this pull request
close #2952

Check list

[x] Code changed are covered with tests, or it does not need tests for reason:
[ ] If any new Jar binary package adding in your PR, please add License Notice according
New License Guide
[x] If necessary, please update the documentation to describe the new feature. https://github.com/apache/incubator-seatunnel/tree/dev/docs

Can we support read the sub path as partition fields ?

Yes, but support this feature not in this pr, it will in #2985

I rebase this PR onto dev.
@TyrantLucifer @EricJoy2048  CC

Overall good, can you add the change log to the corresponding document

Overall good, can you add the change log to the corresponding document

This job I will do in next pr, in next pr I will add all the change log of the connectors that developed by me.


Add Gsheets support for generate CRUD page

Description
Fixes #5945
Type of change

New feature (non-breaking change which adds functionality)

How Has This Been Tested?
Checklist:

[ ] My code follows the style guidelines of this project
[ ] I have performed a self-review of my own code
[ ] I have commented my code, particularly in hard-to-understand areas
[ ] I have made corresponding changes to the documentation
[ ] My changes generate no new warnings
[ ] I have added tests that prove my fix is effective or that my feature works
[ ] New and existing unit tests pass locally with my changes

Test coverage results :test_tube:
:red_circle: Total coverage has decreased
// Code coverage diff between base branch:release and head branch: feature/add-gsheets-gen-crud-page

Status
File
% Stmts
% Branch
% Funcs
% Lines

:red_circle:
total
53.15 (-0.25)
34.85 (-0.15)
31.4 (-0.12)
53.71 (-0.23)

:red_circle:
app/client/src/actions/pageActions.tsx
66.67 (-0.72)
25 (0)
32 (0)
56.25 (-0.89)

:green_circle:
app/client/src/components/ads/Dropdown.tsx
58.46 (1.2)
42.22 (0.55)
28.57 (0)
57.26 (1.01)

:red_circle:
app/client/src/pages/Editor/GeneratePage/components/constants.ts
83.33 (-16.67)
100 (0)
0 (-100)
83.33 (-16.67)

:red_circle:
app/client/src/pages/Editor/GeneratePage/components/GeneratePageForm/GeneratePageForm.tsx
17.02 (-5.52)
9.09 (-6.43)
0 (0)
19.05 (-6.27)

:sparkles: :new:
app/client/src/pages/Editor/GeneratePage/components/GeneratePageForm/GoogleSheetForm.tsx
18.52
0
0
20.83

:red_circle:
app/client/src/pages/Editor/GeneratePage/components/GeneratePageForm/hooks.ts
10.71 (-7.81)
0 (0)
0 (0)
10.08 (-9.92)

:sparkles: :new:
app/client/src/pages/Editor/GeneratePage/components/GeneratePageForm/styles.ts
71.43
100
0
71.43

:red_circle:
app/client/src/reducers/entityReducers/datasourceReducer.ts
8.93 (-0.5)
0 (0)
0 (0)
9.26 (-0.54)

:red_circle:
app/client/src/selectors/entitiesSelector.ts
51.14 (-0.01)
5.41 (0.22)
26.21 (-0.26)
48.45 (-0.25)

:green_circle:
app/client/src/utils/autocomplete/TernServer.ts
50.71 (0.24)
38.6 (0.88)
36.21 (0)
55.35 (0.27)

:x:
app/client/src/pages/Editor/GeneratePage/components/GoogleSheetForm.tsx
36.84
25
0
38.89

./ok-to-test sha=12344a6

/ok-to-test sha=78b1ddd

#6472 issue

/ok-to-test sha=c50f4f3

Need to merge 6664 PR before #6401 PR to avoid merge conflicts.

Merging this PR as all TCs passed expect Smoke_TestSuite/ClientSideTests/OrganisationTests/OrgImportApplication_spec.js which is failing for all PRs AFAIK.


Release-please fails to create tags/release

TL;DR
I have tried release-please v3/4 and literally none of them are working. I get a PR created but no tag/release.
It only worked like 3 times on v3 but for the past 5h it drove me nuts as I have rerun for over 40 times with different configs and nothing...

Please note that it had ran on an Enterprise Server with a self-hosted runner and on a windows machine!!!

Expected behavior
To work I guess..
Observed behavior
I couldn't find anything suspicious as actions logs don't throw errors related to failed creation of tags/releases
The run looks susccessful in github
Action YAML
jobs:
  ci-cd:
    runs-on: [self-hosted, win-machine]
    steps:
      - name: release
        uses: google-github-actions/release-please-action@v3
        id: release
        with:
          token: ${{secrets.GH_TOKEN}}
          default-branch: main
          release-type: node

Log output
Sorry, i can't paste it here as I work on an Enterprise Server and it is very restricted. I don't have access to github.com

Additional information
No response

Nvm, I figured it out 😅


How to add custom data to the session?

For example, while I was using express-session or the other fastify-session plugin, i was able to add custom data by doing req.session.userId='some id' after extending the request object.
I've been trying similar process here by doing something like this but the custom session data isn't getting saved. (as commented in this file - https://github.com/mgcrea/fastify-session/blob/master/src/session/SessionData.ts)
declare module "fastify" {
  interface FastifyRequest {
    session: Session;
  }
}

declare module "@mgcrea/fastify-session" {
  interface SessionData {
    userId: string;
  }
}

Adding it like this -
    await app.register(fastifyCookie);
    await app.register(fastifySession, {
      key: Buffer.from(SESSION_KEY, "base64"),
      crypto: SODIUM_AUTH,
      store: new RedisStore({ client: new Redis(REDIS_URI), ttl: SESSION_TTL }),
      cookie: { maxAge: SESSION_TTL }
    });

then using it here -
    app.get("/set", async (request: FastifyRequest) => {
      request.session.data.userId = "1";
      const id = request.session.data.userId;
      console.log("ID", id);
      return {
        id,
      };
    });

    app.get("/get", async (request: FastifyRequest) => {
      const id = request.session.data.userId;
      return {
        id,
      };
    });

And the custom data that i set does not stay persistent. I've looked into the source code but I'm not exactly able to figure out this issue. The sessionId remains same in both request when i console them.
Thanks.

nvm, i should have read the docs clearly.
TLDR being, rather than using the original fastify module to start the server, I needed to use the buildFastify function that was told in the readme to do that.
  const app = await buildFastify({
    logger: {
      prettyPrint: true
    }
  })

something like this.


Where is redshift process?

When I use QRedshift I dont see process redshift in the system monitor and this script https://gist.github.com/CreamyCookie/d036b66af4e17ea527d08e303eb96145 for mpv don't work. But with applet Redshift (redshift@marvel4u) and redshift-gtk process is and script works well. How QRedshift works w/out running redshift?

This script will not work with QRedshift and that's right.
I don't know how redshift@marvel4u works, but redshift-gtk runs the redshift process in background and keep monitoring his state.
QRedshift runs Redshift in one-shot mode, it means redshift process is called only when changes are made or when triggered by the update interval.
This feature to disable QRedshift for full screen applications has be request before, but for now i have no plans to do that yet, i'm too busy to for now...

I suggest you to use the scroll action to toggle On/Off state, i use that myself.


Grid deployment failures

No sure why I cannot deploy anything:

mainnet set as the taget
trustlines build between 3sdk wallet and lobster wallet
both wallet are able to receive tokens
deployment fails with the following error:

@zaibon I tried to deploy network on testnet worked ok, devnet no node found
Only this issue on main net it can't create a reservation

The problem seems to be the farm doesn't have a wallet address for the required currency. But I need to have the reservation ID to be able to track the problem.


Presentation fix

Coverage remained the same at 60.163% when pulling 49e708ac84d2a7266c666bd90779bc34680d3b4a on GolovPavel:TestBranch into 068cd4c1ff88fe9f06b3051026b8cb249c81186b on rybalkinsd:master.


ChannelData or UserId are not propagated to Bot Framework on Conversation Update events

Version
master
Describe the bug
window.ReactDOM.render(
          <ReactWebChat directLine={directLine} store={store} userID="UserName" />,
        document.getElementById('webchat')
);

Bot Framework backend receives activity with property From.Id set to conversationId instead of UserName. Also when trying to alter channel data, this is propagated only on postactivity events.
To Reproduce
Use code sample above and catch conversation update events on the backend side. UserId equals to conversation Id instead of value set for userId on web chat element.
Expected behavior
Propagate channelData and UserId also for conversation update
[Bug]

@MarekLani, sorry for the late reply, this fell off my radar.
ConversationUpdate is not an activity sent from the bot or user, which is why the fromId is showing as the conversation ID. This by design from the Bot Framework protocol. Our general recommendation is to not use conversationUpdate to retrieve user-related information. Instead, please check out our sample 15.d which shows sending an activity through the client.

@corinagum Thank you for the explanation.


Unpack 1-element tuple returned by transforms.

Context: Transforms are returning 1-element tuples.
Description of the Change: This commit unpacks the 1-element tuples.
Benefits: Matching return types.

@rmoyard see https://github.com/PennyLaneAI/catalyst/pull/574/commits/906648bd3dd0faf855a45861bb7bd5ab8821e27f


AMPI_Alloc_mem returns non-migratable memory

Original issue: https://charm.cs.illinois.edu/redmine/issues/314

From Roberto de Quadros Gomes <rqg.gomes AT gmail.com>

Last week I had a problem very similar to presented by Nicolas Bock about segmentation fault when LB was called.  So, I noticed that my problem started when I started use MPI_Alloc_mem and MPI_Free_mem in AMPI codes. Always when I have a migration between these functions I receive these messages:
CharmLB> GreedyLB: PE [0] step 0 finished at 2.566594 duration 0.008998 s
------------- Processor 1 Exiting: Caught Signal ------------
Signal: segmentation violation
Suggestion: Try running with '++debug', or linking with '-memory paranoid' (memory paranoid requires '+netpoll' at runtime).
------------- Processor 7 Exiting: Caught Signal ------------
Signal: segmentation violation
Suggestion: Try running with '++debug', or linking with '-memory paranoid' (memory paranoid requires '+netpoll' at runtime).
------------- Processor 6 Exiting: Caught Signal ------------
Signal: segmentation violation
Suggestion: Try running with '++debug', or linking with '-memory paranoid' (memory paranoid requires '+netpoll' at runtime).
Charmrun: error on request socket--
Socket closed before recv.
If no migrations is needed, then no problem is shown.
But, whether I back to "malloc" and "free" functions, the LB works fine.
I do not have sure about this functions should be similar, but in my application without MPI_Migrate, works too.
I attached the code where this problem happens.
You can reproduce  building with
.$ampicc mpiteste.c -o mpiteste -module GreedyLB -memory isomalloc -D_Problem
and running it.
If you remove -D_Problem, it works.

Original date: 2013-10-24 23:14:47

Oddly, this test code fails on Mac OS X (net-darwin-x86_64) right after migration regardless of the define. I'm testing the fix on a Linux system, and will figure out what's up with Macs later.

Original date: 2013-10-24 23:24:06

OK, so I forget to compile/link with -memory isomalloc. The test now hangs on Mac OS, with or without -D_Problem. With the fix in place, it now passes on a Linux system (net-linux-x86_64), so I'll integrate the fix.

Original date: 2013-10-26 01:40:49

Roberto reports that his code is now working.


donation

Please enter your bitcoin address, I want to transfer BTC to support your work

18vHMxVzotQ9EPyESrf7Z1hNM9AwJeVHgD
Thank you!!!


Can't compile encrypt.so on ubuntu

Greetings,
I'm following the instruction to compile encrypt.so but here's the result
To build the shared library for OS X or Linux, in the lib folder run make, rename the resulting binary as needed and move to the bot folder. (copied from the README.md)
root@CryptoSiD:~/OpenPoGoBot/lib# make
make: *** No rule to make target 'encrypt.o', needed by 'libencrypt.so'.  Stop.
root@CryptoSiD:~/OpenPoGoBot/lib#
What am I missing?

You will need to either find encrypt.c or the appropriate shared library for your system. The bot will automatically attempt to load the following filenames; another filename can be specified using config options as described below.

You have to find the encrypt.c (or the libencrypt.so what you try to build) by your own.
I guess due to copyright or legal rights ..

Ho well.... what if I'm unable to find it? Look like i can't use that bot anymore

https://github.com/PokemonGoF/PokemonGo-Bot/issues/2778

thanks a lot

For anyone wondering in the future:
http://pgoapi.com/


[QUERY] Accessing Azure app configuration from Azure function using SDK and not client library.

I am accessing my configuration stored in Azure Appconfiguration. I am using SDK (Azure.Data.AppConfiguration) from Azure function. Following the example from https://github.com/Azure/azure-sdk-for-net/blob/Azure.Data.AppConfiguration_1.0.2/sdk/appconfiguration/Azure.Data.AppConfiguration/samples/Sample2_HelloWorldExtended.md
I am keep getting 400 error. The only difference is that I am calling from Azure Functions.
Following is my code
 var client = new ConfigurationClient(_azureAppConfigurationOptions.ConnectionString);
ConfigurationSetting setting = client.GetConfigurationSetting("appid");

Environment:

Name and version of the Library package used: [e.g. Azure.Storage.Blobs 12.2.0]
Hosting platform or OS and .NET runtime version (dotnet --info output for .NET Core projects): [e.g. Azure AppService or Windows 10 .NET Framework 4.8]
IDE and version : [e.g. Visual Studio 16.3]

Any help or insight is appreciated.

Thank you for your feedback.  Tagging and routing to the team members best able to assist.

Hi @athrayee what version of the Azure.Data.AppConfiguration library are you using?
Also, do you see more information returned with the exception? like the message or the error code for it?

@maririos I am using  "Azure.Data.AppConfiguration" Version="1.0.2"
System.Private.CoreLib: Exception has been thrown by the target of an invocation. Azure.Data.AppConfiguration: Service request failed.
{"type":"https://azconfig.io/errors/invalid-argument","title":"Invalid request parameter 'key'","name":"key","detail":"key(0): Suffix and Full Text search is not supported","pos":0,"status":400}

Thanks for confirming. Do you see this while running locally the Azure Functions? or have you already deployed the function in Azure.
If you try to make the call outside of the Azure function does it worked?
I was following the tutorial here https://docs.microsoft.com/en-us/azure/azure-functions/functions-create-your-first-function-visual-studio and integrated our sample https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/appconfiguration/Azure.Data.AppConfiguration/samples/Sample1_HelloWorld.md and was able to get the ConfigurationSetting back, so I am wondering what else could there be happening in your environment/configuration

i am trying it locally and has not published the function app. i do have the app config published in Azure. Also, like i mentioned, it is only not working with SDK and followed the same example as the link. not sure if there is additional config. I am using Connection string, I am looking at it again and will update, but in the meantime if any direction would help.

I'm still experiencing the issue. Is there anything that you are suggesting me to try out differently. @maririos

@maririos just as an alternative, I tried with client library using
"Microsoft.Extensions.Configuration;
Microsoft.Extensions.Configuration.AzureAppConfiguration;
i am able to get the configuration value. just curious to understand why it would be different using SDK than client library.

@athrayee thank you for providing more information. What version of Azure Functions are you using?
This is the code I am using (by following both samples liked above):
public static class HttpExample
    {
        [FunctionName("HttpExample")]
        public static async Task<IActionResult> Run(
            [HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)] HttpRequest req,
            ILogger log)
        {
            log.LogInformation("C# HTTP trigger function processed a request.");
            var client = new ConfigurationClient(<connectionString>);

            string key = req.Query["key"];

            string requestBody = await new StreamReader(req.Body).ReadToEndAsync();
            dynamic data = JsonConvert.DeserializeObject(requestBody);
            key = key ?? data?.key;

            ConfigurationSetting retrievedSetting = client.GetConfigurationSetting(key);

            string responseMessage = string.IsNullOrEmpty(key)
                ? "This HTTP triggered function executed successfully. Pass a name in the query string or in the request body for a personalized response."
                : $"Hello, {key} with value {retrievedSetting.Value}. This HTTP triggered function executed successfully.";

            return new OkObjectResult(responseMessage);
        }
    }

Using:

AppConfig: Azure.Data.AppConfiguration Version="1.0.2"
Azure functions: 3.0.14916.0

you can try it deployed here: https://mariariappconfig.azurewebsites.net/api/HttpExample?key=FontColor (notice that for the function to work in Azure I had to add information in host.json file and that is not included in the tutorial I linked)
you ok sharing more of your code (without keys or connection strings) to see what is happening?

@maririos Thank you so much for your help. Please find my function code
public async Task Run(
[HttpTrigger(AuthorizationLevel.Anonymous, "post", Route = "PostWebAppData")] HttpRequest req,
ILogger log)
{
log.LogInformation($"{nameof(PostWebAppData)} trigger function processed a request.");
         log.LogInformation("test");

        CancellationTokenSource source = new CancellationTokenSource();
        CancellationToken token = source.Token;

        var client = new ConfigurationClient(_azureAppConfigurationOptions.ConnectionString);

         //log.LogInformation($"{client} client value.");

       var  setting =  client.GetConfigurationSetting("appid");

           // log.LogInformation($"{setting}");

        if(!req.Headers.Keys.Contains("appid"))
        {

            return new HttpResponseMessage(System.Net.HttpStatusCode.NotAcceptable);

        }

        else
        {
            Microsoft.Extensions.Primitives.StringValues value = string.Empty;

            log.LogInformation(req.Headers.TryGetValue("appid",out value).ToString());

        var content = await new StreamReader(req.Body).ReadToEndAsync();

        byte[] b = Encoding.ASCII.GetBytes(content);
        MemoryStream ms = new MemoryStream(b);

        FileStream fs = req.Body as FileStream;

        log.LogInformation(content);

         var sasToken =
        _azureStorageTokenGenerator.GenerateSasToken(
            _azureStorageOptions.FilePath);

            log.LogInformation($"{_azureStorageOptions} storage options");

             log.LogInformation($"{_azureStorageOptions.ConnectionString} storage options");

     //   var appid = _azureAppConfigurationOptions.Configuration["therasam:appid"];

        var appid = setting.Value;

        log.LogInformation($"{ appid }");

        string continuationToken = null;

        var blobContainerClient = new BlobContainerClient(_azureStorageOptions.ConnectionString,_azureStorageOptions.FilePath);

        await blobContainerClient.SetAccessPolicyAsync(permissions:sasToken);

       var blobItems = blobContainerClient.GetBlobsAsync(prefix:"Data")
                    .AsPages(continuationToken,1);

                    BlobClient blb = blobContainerClient.GetBlobClient("test-blob");

                log.LogInformation("upload");

                Boolean overwrite = true;

              //  CancellationTokenSource source = new CancellationTokenSource();
              //  CancellationToken token = source.Token;

                    await blb.UploadAsync(ms,
                        overwrite,
                        token);

                    log.LogInformation(blb.ToString());

       await foreach (BlobItem blob in blobContainerClient.GetBlobsAsync())
       {

             log.LogInformation($"{blob.Name} blob name");

           // log.LogInformation(uploadBlobContent.ETag.ToString());
       }

        return new HttpResponseMessage(System.Net.HttpStatusCode.OK);

      // return new HttpResponseMessage(System.Net.HttpStatusCode.NoContent);
    }
    }

@athrayee can you try the function that @maririos has pasted above? Trying to see if that simple function works first before looking into additional issues.


Fix crash on python -m napari

Closes #6483

I need to find the proper way to test it

Test added.

(i'm not a fan of stack being able to be a bool or a list...)

I can confirm this fixes my issue from https://github.com/napari/napari/pull/6479#issuecomment-1821900874

Merging to fix main asap.

Thanks for the quick fix @Carreau!
Can someone explain to me though why that code is run at all when running python -m napari, though? 🤔

You can pass files/plugin to open when starting napari from the CLI and/or activate deactivate plugins. It's the same code that create the default empty viewer than the one the create a viewer and add files/layers.


Texture bug type: Greyscale

Some textures, anywhere they're used, are in greyscale.
These are:
- water
- melon stem
- pumpkin stem
- vines
- grass
- sides and bottom of redstone dust

If someone can edit the colors on this to make it look right, i will accept a PR or add it in and submit a PR on your behalf.
You can fix it in your local copy by modifying the texture files in Vanilla_Resource_Pack\textures\blocks\
If you cant figure out how to do a PR please attach the images to this bug and i will fix it and put it in the pack. They are rendered grey scale for the same reason redstone dust was in my very first version... the image is in grey scale.

You can use the water_still.png instead of water_still_grey for a blue version.

I didn't consider the 16 dust states, so let me know if that needs doing.

If someone can edit the colors on this to make it look right, i will accept a PR or add it in and submit a PR on your behalf.
You can fix it in your local copy by modifying the texture files in Vanilla_Resource_Pack\textures\blocks\
If you cant figure out how to do a PR please attach the images to this bug and i will fix it and put it in the pack. They are rendered grey scale for the same reason redstone dust was in my very first version... the image is in grey scale.

You can use the water_still.png instead of water_still_grey for a blue version.

I didn't consider the 16 dust states, so let me know if that needs doing.

Adding to Voidredstone comment, if the grass_carried.png is used, there's no need to erase the dirt part, it should work just fine as it is.

Adding to Voidredstone comment, if the grass_carried.png is used, there's no need to erase the dirt part, it should work just fine as it is.

Merged

Merged


bash -e causes unattended install failure on slow start

This section of the script appears to be polling the freshly started sql server instance to see if it is up and appears to expect a non-zero exit status if the sql server instance is not yet started at the time of polling.
# Connect to server and get the version:
counter=1
errstatus=1
while [ $counter -le 5 ] && [ $errstatus = 1 ]
do
  echo Waiting for SQL Server to start...
  sleep 3s
  /opt/mssql-tools/bin/sqlcmd \
    -S localhost \
    -U SA \
    -P $MSSQL_SA_PASSWORD \
    -Q "SELECT @@VERSION" 2>/dev/null
  errstatus=$?
  ((counter++))
done

Meanwhile in the shebang #!/bin/bash -e the -e seems to cause the script to exit if any command (including the polling attempts) returns a non-zero exit status?
I was running this script more-or-less verbatim as a vagrant provisioner and the step was failing after the first Waiting for SQL Server to start... (but was succeeding on a different machine) removing the -e seemed to allow the script to finish and so-far has been working for me but might prevent the script from failing if a real failure occurs.

Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ID: 96990aff-bdd7-3cdd-d801-d544178cfb4d
Version Independent ID: 6b083b6d-56b7-5a1e-3279-ae9f870e7811
Content: Unattended install for SQL Server on Ubuntu - SQL Server
Content Source: docs/linux/sample-unattended-install-ubuntu.md
Product: sql
Technology: linux
GitHub Login: @VanMSFT
Microsoft Alias: vanto

@ajs5710 -- thank you for your research and feedback.
@VanMSFT -- please look into this issue 3609.

@ajs5710 Thanks for this information. This does seem to be a conflicting requirement in the script. We will look into it. Just to let you know, @VanMSFT is out of the office for the rest of this month, but he will take a look when he returns. Thanks in advance for your patience, and really appreciate the details in your research.

@ajs5710 - Thanks for reporting this failure in the script. We will look into this further.

Hi @ajs5710 - Thanks again! I apologize for the delay. I have added a note to clarify that the script might fail with the -e switch since we are exiting with a non-zero status for a slow SQL Server start. We appreciate your help on our documentation!


vc/llvm14

add generator
Add headers for LLVM 14

I think you'll need to update https://github.com/JuliaLabs/MLIR.jl/blob/main/.github/workflows/CI.yml since it currently uses specific julia and LLVM commits

Codecov Report

:exclamation: No coverage uploaded for pull request base (main@a2fd22a). Click here to learn what that means.
 Consider uploading reports for the commit 4e74b38 to get more accurate results

:mega: This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more
Additional details and impacted files
@@           Coverage Diff            @@
##             main        #9   +/-   ##
========================================
  Coverage        ?   100.00%
========================================
  Files           ?         1
  Lines           ?         1
  Branches        ?         0
========================================
  Hits            ?         1
  Misses          ?         0
  Partials        ?         0

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.


RLM-1457 Fix lxc cache prep resolvers

Recent changes in the upstream LXC images have resulted in breakage
caused by busted symlinks, likely to the image moving to
"systemd-resolved". This change backports the process we use in master
to create the cache resolvers which will ensure we're not having to deal
with this issue.
This forks the openstack-ansible-lxc_hosts to rcbops since newton
is now classified as EOL upstream.
Issue: RLM-1457

recheck_all

recheck_cit_xenial_swift_deploy

recheck_cit_artifact

recheck_cit_artifact

recheck_cit_artifact

Good catch Matt Thompson!


Improve step_walker

Improve step_walker

Can instanciate walkers one time and call step() multiple times on the same walker
Speed randomized at each step
Speed can be overridden in the step parameter to pass 0 to anything

@Anakin5 you'll need to adopt some test cases

We need to modify offset angle as well to base it on km rather than speed.

the offset angle formula ensures precision in centimetres

I will add back the step override in Polyline to check that we walk the last polyline point.

@Anakin5  I think i have a better solution...
PolylineWalker does not send the dest to StepWalker as the next step but the real destination...
It will only override the bearing with the local heading.
https://github.com/Anakin5/PokemonGo-Bot/pull/1/commits/09831cf72081fa81bcfb7138f1b67f7c195d7824   in the PR https://github.com/Anakin5/PokemonGo-Bot/pull/1 towards your branch

That makes the StepWalker not very consistent. I think bearing should stay an internal variable, not something we can override.
Otherwise, next time we want to introduce some noise or change our calculation, we have to modify all caller of StepWalker.
What is the last point that we are trying to address ? Is it the return value of step() for polyline ?

@Anakin5  I updated my comment check the display bit also...

What is the last point that we are trying to address ? Is it the return value of step() for polyline ?

Can the Polyline override a get_bearing function instead of passing it by parameter ?

@Anakin5 that is also a solution...

Can the Polyline override a get_bearing function instead of passing it by parameter ?

Ok. Can you commit based on last version of the branch and I will merge it ?

@Anakin5 Done... https://github.com/Anakin5/PokemonGo-Bot/pull/1

@Anakin5 i have no time to test now... please check if overriding the _calc_bearing like that works... it should right?

I will do the same for the fixed_speed and create a get_speed. For the bearing, we could name it get_bearing, because I think it makes sense to expose this value to outside world for reading.

I will test if it works

@Anakin5  do not remove the fixed_speed.... we can use that to teleport or stay put... that is a nice good to have!

that will also allow follow task to reduce the speed in certain condition... in locality of pokestops pokemons... whatever...

@Anakin5 Updated above comment...

I commited the verison I am testing, I added:

Can instance walkers one time and call step several time on the same walker
Speed randomized at each step
Speed can be overridden in the step parameter to pass 0 to anything

@Anakin5  i don't like it... your know why?
PolylineWalker generated the pol_lat and pol_lng based on a speed generated at init time... in order to pass it using this approach we have to override step again... in PolylineWalker which would not be the case if we keep it as an init argument....

One point remaining is computation of the bearing with altitude.

@Anakin5 what do you mean....?

One point remaining is computation of the bearing with altitude.

I meant what I just commited lol

if total_distance == 0
you have a DivisionByZero exception in:
dist / total_distance
we need something like...
if total_distance = 0:
    next_alt = orig_alt
else:
    next_alt = dest_alt + random_alt_delta()

why did you changed the offset_angle formula to 100/dist instead of 1/dist?
instead of  1/dist???
offset_angle = (100 / dist) * (precision / 1.74)

Please correct the angle formula
Correct dist=2 precision = 50 cm resulting angle 14 degrees
In [8]: (1/2.0)*(50/1.74) % 360
Out[8]: 14.367816091954023

Incorrect dist=2 precision = 50 cm resulting angle 356 degrees
In [9]: (100/2.0)*(50/1.74) % 360
Out[9]:<PHONE_NUMBER>954023

In [10]:

I put the precision in meters to be consistent with other units. That is not centimeters anymore.

if total_distance == 0
you have a DivisionByZero exception in:
dist / total_distance
we need something like...
if total_distance = 0:
next_alt = orig_alt
else:
next_alt = dest_alt + random_alt_delta()

There is a check for total_distance zero few lines above

@Anakin5
offset_angle when total_distance = 0 is  off
In [17]: (100/0.5)/(0.5/1.74) % 360
Out[17]: 336.0
that is about 0.5m away from origin and will start spiralling with a 336 bearing
In [32]: haversine.haversine((0,0), tuple(VincentyDistance(kilometers=0.5 * 1e-3).destination(Point(0,0), 0 + (100/0.5)/(0.5/1.74) % 360)[0:2]))*1000
Out[32]: 0.5022511946715152

In [33]:

What do you want to do when distance is zero ?
For me, staying in the precision circle around the position is the behavior I am expecting.

@Anakin5
I think we have to stay put... that is the safest bet..
if i run for lets say 30min StepWalker.step(speed=0)... we really have to stay put.. otherwise there is no way to predict where we will be...

What do you want to do when distance is zero ?
For me, staying in the precision circle around the position is the behavior I am expecting.

It looks like that:

We should not repeatedly send the exact same position.

@Anakin5 but then for that case... 0.5 m is to much away...

We reduce the precision then :)

when you choose the dest = precision...
offset_angle = (100/X)*(X/1.74) = 100/1.74 =  57.47126436781609 degrees always...
in that formula even if you change precision result will be the same

@Anakin5
dist should be:
dist = min(total_distance, speed)
lets not involve the precision here..
now for total_distance=0
if total_distance = 0:
    total_distance = 1e-3 # 1cm

that is 1cm away... makes sense?

In [75]: haversine.haversine((0,0), tuple(VincentyDistance(kilometers=1e-3 * 1e-3).destination(Point(0,0), 0 + (100/1e-3)*(0.5/1.74) % 360)[0:2]))*1000
Out[75]: 0.0010001441598963957

In [76]:

I don't understand what you are trying to achieve.

When distance = 0, we do not care at all about the bearing or offset angle. The formula can return whatever.
We do not want to send the same position many times.
What is the purpose of the precision if next to the destination point, you modify it to 1cm ?

lets stay i want to stay put for 10min
i do StepWalker.step(speed=0) right
600sec*50cm = 300m from original stay put lication....

No your destination does not change. You always stay in a circle of radius your precision around your destination point.
See my screenshot, that is 30 minutes stay put.

your destination will change because origin will change origin will be (bot.position[0], bot.position[1]) which just was updated one step above....

Origin will change, not destination. Bearing will be recalculated.

That if you pass the same destination always... (Which should be the case...)

Origin will change, not destination. Bearing will be recalculated.

@Anakin5 and i have to apologise if you think i commented to much on your PR :)

Its ok :)

I see what you mean for the stay put thing. You want to stop the walker in the middle and not at the end, right ?

@Anakin5 yes... that would be a problem, even if destination does not change...
Let's compromise in total_distance = 1e-2  or 1e-3 what do you think?
if we stay put in the middle... then it will be no problem...
I am thinking of some sleep_schedules that might use that to stay put at time X (in the middle of walk) and still update the position...

I see what you mean for the stay put thing. You want to stop the walker in the middle and not at the end, right ?

@Anakin5 I wonder what is the gps precision when stationary...

my phone returns 9mm

@Anakin5 I wonder what is the gps precision when stationary...

Ok we can reduce the value.
I want to say also that calling with speed=0 without giving the proper destination is not a valid use case.
Since we will not always return the same position, we need to know around which point we have to stay. And that is not the origin point, otherwise we could slowly deviate from the position we actually want to stay.
So that is a requirement to give the position at which you want to stay in destination.

@Anakin5 but if we reduce the value it should be enough we  will still drift towards the final destination but just slowly...

@Anakin5 actually for the PolylineWalker the speed=0 even if you say total_distance= self.precission
the polyline.set_speed(0) and .get_pos() will return same intermediary point that it will ensure we drift around same area....
For the main StepWalker... it will drift towards final destination (and I don't care much about the main StepWalker use without the PolylineWalker) thus you decide...

Yes it is not major issue, but that would still be nicer to remember where we initially stopped and want to stay around.

@Anakin5 outdoor precision stationary cloudy day is 2m for me... (iPhone)

@Anakin5 I know...
you fixed it in StepWalker
now we can set it to 0.5 in PolylineWalker something like:
PolylineWalker(StepWalker):
     def __init__(self, x,y...)
            super(PolylineWalker, self)._init(x,y,...)
            self.static_precision = 0.5

could you do that if you agree and have time...

I am thinking about saving the position when speed=0 and talking that saved position as center point when subsequent speed=0 calls.
That way, the precision is not involved and things work whatever is the precision given

@Anakin5 what do you have in mind?
I don't believe you can save it this object are volatile.. new ones are being created on next .tick()

I am thinking about saving the position when speed=0 and talking that saved position as center point when subsequent speed=0 calls.
That way, the precision is not involved and things work whatever is the precision given

I love you guys :smile:

Well, you cannot wait somewhere without providing the location. Either the destination is correct at initialisation of the StepWalker (so we have it in get_next_step), either the same object is reused.
I don't plan to cover the scenario in which the user create a brand new StepWalker, with origin A, destination B, and intend to stay put at C. Or at least, if he does that, then he reuse that same StepWalker as long as he is waiting. Otherwise I have no object to save the position.

all tasks... have a .work() with returns WorkerResult.SUCCESS or WorkerResult.RUNNING in their .work() method right?
but the problem is that they usually create the StepWalker object on each .work()

@Anakin5 Well, you cannot wait somewhere without providing the location. Either the destination is correct at initialisation of the StepWalker (so we have it in get_next_step), either the same object is reused.
I don't plan to cover the scenario in which the user create a brand new StepWalker, with origin A, destination B, and intend to stay put at C. Or at least, if he does that, then he reuse that same StepWalker as long as he is waiting. Otherwise I have no object to save the position.

To ensure they do not deviate too much from the expected location, tasks that want to wait somewhere will have to create a StepWalker with the destination where they want to wait, or reuse the same StepWalker across calls. Is it acceptable thing ?

@Anakin5 what along discussion around:
total_distance = self.static_precision
now that we agreed is the Task resposability
do we want self.static_precision to 0.5m  because the PolylineWalker is safe from that potential problem.. what to you think? :))

I looked at the failing test cases, after fixing the obvious dLat, dLng which are now dest_lat, dest_lng variable name changes...  and passing precision=0 to StepWalker initialisation, we have 2 out of 4 failing:

test_small_distance_same_spot
test_small_distance_small_step

they are both by the fact the we now do a position changes even on stay put, and on small distance.
I don't think those test cases make sense...
We should make sure that we do change the bot.position even if by little... the android or iOS changes location constantly why wouldn't we do that also...
I vote for removal of those 2 test cases...

Lol I was looking into them as well.
I choose to keep the static_precision that we have for the PolylineWalker as well. Just so that we have consistent behavior when staying put.

Should be able to handle any precision now, even with speed zero

I am done once test cases passes. We can figure out what to do with test cases in another PR maybe.

fbc0282 you will have to patch random.uniform in test cases now since precision is at least 0.01cm...

Yes a lot of things to change in these tests cases :s

@Anakin5 i tried to help https://github.com/Anakin5/PokemonGo-Bot/pull/2 :)

This is a very good PR, I like your coding style @Anakin5
now everything is much easy to read...

thx, I am pain in the ass for my colleagues though ;)
I take a rest and will fix tests later, until you fix them :P

@Anakin5 i adopted the test cases and opened a PR to your branch
https://github.com/Anakin5/PokemonGo-Bot/pull/3

@Anakin5 https://github.com/Anakin5/PokemonGo-Bot/pull/3/commits/923e8fd67a280dfae9651bcb082d756eb52638b4 updated few more test cases and added back float("inf") which you have stollen :)
test_big_distances (pokemongo_bot.test.step_walker_test.TestStepWalker) ... ok
test_normalized_distance (pokemongo_bot.test.step_walker_test.TestStepWalker) ... ok
test_normalized_distance_times_2 (pokemongo_bot.test.step_walker_test.TestStepWalker) ... ok
test_small_distance_same_spot (pokemongo_bot.test.step_walker_test.TestStepWalker) ... ok
test_small_distance_small_step (pokemongo_bot.test.step_walker_test.TestStepWalker) ... ok
test_stay_put (pokemongo_bot.test.step_walker_test.TestStepWalker) ... ok
test_teleport (pokemongo_bot.test.step_walker_test.TestStepWalker) ... ok

I just realised that the test_case don't properly mock the bot.position which is used by StepWalker is_arrived()
I will look into mocking the bot.position...

@th3w4y
For Polyline, I got the same algo, just written using the get_next_position of the StepWalker.

still off with speed in m then the position you should be at!

I don't understand, can you explain ?

For now result are good except when precision is greater than the distance to travel. But it is something to adjust in StepWalker rather than Polyline.

@th3w4y
I fixed some issues, they might be was you were referring to but I am not sure. I want to be able to support big precision and that is now the case.

2.5 meters precision:

i was trying to write some test cases for the polyline_generator in line with a similar approach what you have in PolylineWalker now
I am stocked in a loop when speed > distance...
I am not done yet, but the fact that you removed the .get_pos() makes it difficult..
you could have just rename it _get_pos() and not use it in the PolylineWalker :) then the polyline_generator_test.py would not been easily made to pass :)
we would have only needed to write new test cases for PolylineWalker....

We can create a function to return the position of the current step and one to increment the step. Maybe that would make it easier to test and I could use them in the code as well in fact.

lets have a side conversation on https://github.com/Anakin5/PokemonGo-Bot/pull/3

Speed > distance should return the last point of the Polyline according to what I wrote in get_next_position

This branch is out-of-date with the base branch
The Travis CI build failed
....

@solderzzc They're not finished yet :)

probably the PR of the month with the nr of comments and changes involved

@mjmadsen  Oh, sure.

I created test cases for PolylineWalker  https://github.com/Anakin5/PokemonGo-Bot/pull/4 after @Anakin5's  changes and I can tell you all it looks very good except an small altitude issue regarding to which altitude the PolylineWalker would pick from the Polyline object but i am sure @Anakin5  will fix them tommorow.

We need to declare the polyline ressources files as binary because on windows they get checkout with windows line endings and it messes up the pickle.

Updated test case - activated the altitude check part...
test_one_small_speed (pokemongo_bot.test.polyline_walker_test.TestPolylineWalker) ... ALTITUDE [polyline:<PHONE_NUMBER>98 bot:<PHONE_NUMBER>94]
FAIL
test_one_small_speed_big_precision (pokemongo_bot.test.polyline_walker_test.TestPolylineWalker) ... ALTITUDE [polyline:<PHONE_NUMBER>98 bot: 4.47246046117]
FAIL
test_stay_put (pokemongo_bot.test.polyline_walker_test.TestPolylineWalker) ... ALTITUDE [polyline:<PHONE_NUMBER>98 bot: 0.159921135161]
FAIL

@Anakin5 I think i will change the .get_alt(at_point=None) to take a point parameter and identify the closest two point and return their average altitude if no point given that would return altitude at self._last_pos

No average, it won't work as well, but more check that we are in between

@Anakin5 i meant a weighted "average"  i will actually return the this point

ok, you do the projection or you just get the distance travelled somewhere ?

@Anakin5 i updated the photo

@Anakin5 the logic to calculate the hight will be something like this
at_point = point you want to find elevation
p1, p2 are the closest 2 points on the polyline that we know the elevation

    def get_relative_hight(self, point, p1, p2):
        ep1 = self._elevation_at_point[p1]
        ep2 = self._elevation_at_point[p2]
        hdelta = ep2 - ep1
        distance_p1_p2 = distance(p1, p2)
        distance_to_p1 = distance(p1, point)
        distance_to_p2 = distance(p2, point)
        elevation = ((math.pow(distance_p1_p2,2) - math.pow(distance_to_p1,2) + math.pow(distance_to_p2,2)) * hdelta)/ (3 * distance_p1_p2) + ep1
        return elevation

Can someone check my trigonometry?

I do not get where the elevation formula comes from, an my trigonometry skills are fine :)

I get almost the same. I will check my signs
ep1 + ((distance_p1_p2**2 + distance_to_p1**2 - distance_to_p2**2) / (3 * distance_p1_p2)) * (ep2 - ep1)

@Anakin5 I will check the same...

I have something like that:
d1**2 = x**2 + h**2
d2**2 = (d12 - x)**2 + h**2

d1**2 - x**2 = d2**2 - (d12 - x)**2
d1**2 - x**2 = d2**2 - (d12**2 - 2*d12*x + x**2)
d1**2 - x**2 = d2**2 - d12**2 + 2*d12*x - x**2
d1**2 = d2**2 - d12**2 + 2*d12*x
d1**2 - d2**2 + d12**2 = 2*d12*x
(d1**2 - d2**2 + d12**2) / 2 = d12*x

@Anakin5 yes i reverted the signs by mist ache when writing the code on my IDE on paper was correct
    def get_relative_hight(self, point, p1, p2):
        ep1 = self._elevation_at_point[p1]
        ep2 = self._elevation_at_point[p2]
        hdelta = ep2 - ep1
        distance_p1_p2 = distance(p1, p2)
        distance_to_p1 = distance(p1, point)
        distance_to_p2 = distance(p2, point)
        elevation = ((math.pow(distance_p1_p2,2) + math.pow(distance_to_p1,2) - math.pow(distance_to_p2,2)) * hdelta)/ (3 * distance_p1_p2) + ep1
        return elevation

the remaining bit would be to identify the closest 2 points... but i have not much time to write that bit now :(

I was doing some test with geographiclib stuff and just realized it is freaking expensive to compute stuff with it. It takes several seconds to compute the distance to all forts in the cell.

@Anakin5 would take a second to calculate them all using Google DistanceMatrix API you would even get walking distances not geometrical distances

I want to add something is for the sleep(1). I want so that we take into account the last time we were called. There is no need to sleep 1 second if time already passed more than that.

Were you able to get the tests working with the altitude formula ?

yes
i finished rewrite of get_alt
I use KDTree to calculated closest 2 points in the cluster... something you could reuse for forts...
   def get_alt(self, at_point=None):
        if at_point is None:
            at_point = self._last_pos
        if self._elevation_kdtree:
            p1, p2 = np.array(self._elevation_at_point.keys())[self._elevation_kdtree.query(at_point, k=2)[1]]
            return self._get_relative_hight(at_point, tuple(p1), tuple(p2))
        else:
            return None

    def _get_relative_hight(self, point, p1, p2):
        ep1 = self._elevation_at_point[p1]
        ep2 = self._elevation_at_point[p2]
        hdelta = ep2 - ep1
        distance_p1_p2 = distance(p1, p2)
        distance_to_p1 = distance(p1, point)
        distance_to_p2 = distance(p2, point)
        elevation = ((math.pow(distance_p1_p2,2) + math.pow(distance_to_p1,2) - math.pow(distance_to_p2,2)) * hdelta)/ (3 * distance_p1_p2) + ep1
        return elevation

One one test case in polylineWalker is failing
Altitude on stay put... but i guess i should have initiated the bot with some altitude for that test case
test_bigger_then_total_speed (pokemongo_bot.test.polyline_walker_test.TestPolylineWalker) ... ok
test_bigger_then_total_speed_big_precision_offset (pokemongo_bot.test.polyline_walker_test.TestPolylineWalker) ... ok
test_intermediary_speed (pokemongo_bot.test.polyline_walker_test.TestPolylineWalker) ... ok
test_intermediary_speed_big_precision (pokemongo_bot.test.polyline_walker_test.TestPolylineWalker) ... ok
test_one_small_speed (pokemongo_bot.test.polyline_walker_test.TestPolylineWalker) ... ok
test_one_small_speed_big_precision (pokemongo_bot.test.polyline_walker_test.TestPolylineWalker) ... ok
test_polyline_fetched (pokemongo_bot.test.polyline_walker_test.TestPolylineWalker) ... ok
test_stay_put (pokemongo_bot.test.polyline_walker_test.TestPolylineWalker) ... ALTITUDE [polyline:<PHONE_NUMBER>47 bot: 0.0892242152855]
FAIL
test_teleport (pokemongo_bot.test.polyline_walker_test.TestPolylineWalker) ... ok

======================================================================
FAIL: test_stay_put (pokemongo_bot.test.polyline_walker_test.TestPolylineWalker)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/oghinet/Checkout/public/PokemonGo-Bot/pokemongo_bot/test/polyline_walker_test.py", line 280, in test_stay_put
    self.assertTrue(abs(self.polyline.get_alt() - self.bot.position[2]) <= 1)
AssertionError: False is not true

----------------------------------------------------------------------
Ran 9 tests in 0.366s

FAILED (failures=1)

@Anakin5 I modified the test case on stay_put it makes sense that altitude does not change much...
test_bigger_then_total_speed (pokemongo_bot.test.polyline_walker_test.TestPolylineWalker) ... ok
test_bigger_then_total_speed_big_precision_offset (pokemongo_bot.test.polyline_walker_test.TestPolylineWalker) ... ok
test_intermediary_speed (pokemongo_bot.test.polyline_walker_test.TestPolylineWalker) ... ok
test_intermediary_speed_big_precision (pokemongo_bot.test.polyline_walker_test.TestPolylineWalker) ... ok
test_one_small_speed (pokemongo_bot.test.polyline_walker_test.TestPolylineWalker) ... ok
test_one_small_speed_big_precision (pokemongo_bot.test.polyline_walker_test.TestPolylineWalker) ... ok
test_polyline_fetched (pokemongo_bot.test.polyline_walker_test.TestPolylineWalker) ... ok
test_stay_put (pokemongo_bot.test.polyline_walker_test.TestPolylineWalker) ... ok
test_teleport (pokemongo_bot.test.polyline_walker_test.TestPolylineWalker) ... ok

----------------------------------------------------------------------
Ran 9 tests in 0.335s

OK

Why do we need closest 2 points ? Algo is using previous and next point.

because actually previous calculations were incorrect...
the elevation dictionary does not contain elevation at the polyline points... but along the polyline thus even for origin we still have to calculate...

So there is no point doing any projection then. We just gives altitude of the nearest point.
The get_relative_high should help us for the test cases but we should not use it in our Algo otherwise that is like doing 2 times the calculation (1 time in get_next_position an 1 time in get_alt)

I have to study more how far away are the elevation samples... but you understand... at least now is correct!

So there is no point doing any projection then. We just gives altitude of the nearest point.
The get_relative_high should help us for the test cases but we should not use it in our Algo otherwise that is like doing 2 times the calculation (1 time in get_next_position an 1 time in get_alt)

@Anakin5 we don't nee to do it with the geopraphillib... if we just do without looking at the earth curvature... it would not matter because we calculate to get deltas in elevation not distances in meters...
thus i guess i could use scipy.pdist there... to get the distances!

I guess the polyline is monotone so your computation of nearest 2 points actually return the point before and the point after. That explains why it works. But we could just do that, get the point before and the one after.

@Anakin5 what you propose will be harder if you look at the picture...
I have more elevation samples ( i can get up to 512 in one API call ) then polyline points!

@Anakin5 yes the response from the Elevation API is monotone.. because i request X samples of elevations on the encoded polyline... (the result from Directions...)
but is not sure that the polyline points coincide with the elevation points... at any point on the line they are probably just equally spread across the polyline...

OK. What is this kdtree thing doing besides computing distance between points ?

why not something like elevation_points.sort(distance)[:2] ?

@Anakin5 KDTree is way faster.

How does kdtree evaluate distances between points ?

@Anakin5 the KDtree creates a tree on init and then the .query(is very fast...)

@Anakin5  that is why i was saying that you can also use it for the find_closest_fort...!

euclidean distance but you can change the method if you like!

How does kdtree evaluate distances between points ?

In [14]: %timeit polyline.get_alt()
The slowest run took 5.14 times longer than the fastest. This could mean that an intermediate result is being cached.
1000 loops, best of 3: 585 µs per loop

In [15]:

i brough it down to
In [5]: %timeit p.get_alt()
1000 loops, best of 3: 270 µs per loop

In [6]:

Changed to guppy on @Anakin5  suggestion since scipy wan not easy to compile on windows...
    def get_alt(self, at_point=None):
        if at_point is None:
            at_point = self._last_pos
        if self._elevation_at_point:
            (distance_to_p1, ep1, p1), (distance_to_p2, ep2, p2) = sorted([(great_circle(at_point, k).meters, v, k) for k, v in self._elevation_at_point.items()])[:2]
            distance_p1_p2 = great_circle(p1, p2).meters
            return self._get_relative_hight(ep1, ep2, distance_p1_p2, distance_to_p1, distance_to_p2)
        else:
            return None

    def _get_relative_hight(self, ep1, ep2, distance_p1_p2, distance_to_p1, distance_to_p2):
        hdelta = ep2 - ep1
        elevation = ((math.pow(distance_p1_p2,2) + math.pow(distance_to_p1,2) - math.pow(distance_to_p2,2)) * hdelta)/ (3 * distance_p1_p2) + ep1
        return elevation

We are done I think. Waiting for confirmation form @th3w4y

I've tested it locally, seems no issue

@Anakin5 looks good 👍

👍

@Anakin5 you would only need to rebase...

@th3w4y  will you merge ?

@solderzzc i'll wait for @Anakin5  to rebase on dev

@Anakin5 @solderzzc Merged!


Webapp: az webapp deployment github-actions add fail with unexpected error

This is autogenerated. Please review and update as needed.
Describe the bug
It seems to creating file start with slash /.github/workflows/main_toshida-gha-webapp2.yml
Command Name
az webapp deployment github-actions add
Errors:
The command failed with an unexpected error. Here is the traceback:
422 {"message": "path cannot start with a slash", "errors": [{"resource": "Commit", "field": "path", "code": "invalid"}], "documentation_url": "https://docs.github.com/rest/reference/repos#create-or-update-file-contents"}
Traceback (most recent call last):
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/appservice/custom.py", line 4717, in add_github_actions
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\github/Repository.py", line 1789, in get_contents
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\github/Requester.py", line 353, in requestJsonAndCheck
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\github/Requester.py", line 378, in __check
github.GithubException.UnknownObjectException: 404 {"message": "Not Found", "documentation_url": "https://docs.github.com/rest/reference/repos#get-repository-content"}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 231, in invoke
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 658, in execute
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 721, in _run_jobs_serially
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 692, in _run_job
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 328, in __call__
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 121, in handler
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/appservice/custom.py", line 4744, in add_github_actions
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\github/Repository.py", line 2090, in create_file
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\github/Requester.py", line 353, in requestJsonAndCheck
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\github/Requester.py", line 378, in __check
github.GithubException.GithubException: 422 {"message": "path cannot start with a slash", "errors": [{"resource": "Commit", "field": "path", "code": "invalid"}], "documentation_url": "https://docs.github.com/rest/reference/repos#create-or-update-file-contents"}

To Reproduce:
Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

Put any pre-requisite steps here...
az webapp deployment github-actions add --repo {} -g {} -n {} --token {} -b {} --verbose

Expected Behavior
Environment Summary
Windows-10-10.0.22000-SP0
Python 3.8.9
Installer: MSI

azure-cli 2.31.0

Additional Context

Routing to service team to take a look. Please expect delay due to the holiday season.

Great, please add comment if you still face the issue

Yes it still happen.
I can use workaround what I commented on https://github.com/Azure/azure-cli/issues/20808#issuecomment-999480618
Please add permanent fix.

@calvinsID Can you take a look at this change.

@calvinsID / @StrawnSC is this fixed? who is working on this fix, if this is not?

This looks to be fixed in the add command, just made PR for the remove command


Disposing Cache Expiration objects

I was wondering if it would be possible to call "Dispose" on objects which are getting removed from cache
I couldn't find anything about this quickly

You mean CacheManager should call Dispose on an object which gets removed?
No that's not possible and also doesn't make a lot of sense

does not make a lot of sense ? so in short we should leave in the memory leaks ?

No, I think you should just not cache objects which are disposable/complex which may keep references to stuff like a Stream... That's just a bad idea.
As long as you cache POCOs you do not have to do anything. GC will handle it at some point.
But to clarify why it is not possible. In some cache systems, I don't get any notification or callback when an item gets removed due to cache policies. So there is no way to tell when the item got removed.


Automatically mount home directory

(This is a reopening of https://github.com/boot2docker/boot2docker/issues/84 now that the CLI is a separate project.)
This is related to https://github.com/boot2docker/boot2docker/pull/284. If the boot2docker VM has some way of mounting directories on the host machine, it is pretty useless unless this is exposed somehow in the CLI.
The simplest and most powerful option I can see is automatically mounting your home directory at the same place inside the VM. For example, mounting /Users/ben on OS X at /Users/ben inside the VM. This works brilliantly for Docker volumes, because you can run docker run -v .:/code ... and it Just Works because . expands to /Users/ben/....
It could also mount the entirety of /Users, but I'm not sure on the details of how the permissions would work.

Sorry, this repository is long-since deprecated in favor of Docker Toolbox (whose usage is now also discouraged in favor of Docker for Windows and Docker for Mac).


about namespace wng

Dear author,
I cloned your project and try to build it on my raspberrypi,
but when I try to make it, it shows the error msg:wng is not a namespace-name
it works after I remove line 17 in ofApp.h, is it ok?

Hi @cloudsan
No worries, yeah thats fine I need to remove the reference.
It was for a CSV module where you could store it in case the network goes down.
I'll commit the changes next week.
Thank you for spotting this, let me know how it goes.
Best
David


Important: Course Allocation not working

when I tried to allocate a course, the courses field was not showing up, please do look out and help me on this!

Have you at least created a Session, a Semester, and then a Course before trying to allocate it to a lecturer?

where will you create the course


Block peer - disable connections to this peer

There needs to be a way to block a peeer, thus preventing connections to this peer for specified amount of time. More detailed spec and architecture proposal: https://hackmd.io/fLduHj71RVaPktB-8yc_lQ.

@pradovic , thank you for making this. Given that we are gearing up towards the release, I would propose to put this issue at a lower priority now. Let's first finish all that we plan to release. Thanks for making the architecture proposal.


No button to move back to homepage from leaderboard page

No button to move back to homepage from leaderboard page, so if one goes there then gets stuck and has to reopen the website and their progress track is lost. Kindly assign me , I can fix the routing which will allow user to go from leaderboard back to home page , I'll add button for that .Under gssoc'24 @Dev-tanay

plz label as ggsoc
Hey there! It sounds like a crucial fix to ensure a seamless user experience on the leaderboard page. I'd love to help address this issue by implementing the necessary routing and adding a button for users to navigate back to the homepage. Assign me the task, and I'll get right on it!

Hello, I would like to work on this issue. Kindly assign this task to me.


Fenced code blocks do not receive pre tag

Suppose I have a database entry where I have the following "code block"
(triple back tick)
some fenced code block
another line
(triple back tick)
I also have the following model method in django models.py
def get_markdown(self):
    	return mark_safe(markdown(self.body))

... where body = models.TextField()
Then the result being returned by the method is the following html code...

some fenced code block
another line

The
 tag is missing and it also displays inline rather than receiving the line break.

Hey, I have a feeling that this may be an issue with the underlying 'pagedown' library created by StackOverflow. I'll check it out and get back to you

Thank you for the prompt response

It was indeed an outside issue. More specifically, it was an issue django-markdown-deux
I have resolved the issue... more details here https://github.com/trentm/django-markdown-deux/issues/20


Leak checker misses pointers cast to integer

The leak checker considers allocations live when they can still be reached from a static. However, this scan can only consider pointers that are still stored as pointer values (with provenance), not pointers cast to an integer.
This causes false positives, at least, for

Windows Mutex (https://github.com/rust-lang/miri/issues/1302)
crossbeam (https://github.com/crossbeam-rs/crossbeam/issues/464)

For crossbeam, it turns out the pointer is not just cast to an integer, it also has its last bits repurposed to store some flags.
I would say trying to preserve provenance across these bitwise operations is conceptually just not the kind of semantics that Miri should give to Rust. It's also a game of whack-a-mole to get ever more effective at preserving provenance -- a game that the proper support for ptr-int-casts that we have now is supposed to just end, so I do not have a big interest in re-opening that game.
Another option might be to expect libraries that pull such tricks (storing the pointers that keep an allocation live without provenance) to give us some extra hints, via some Miri-specific instrumentation/intrinsics or so. (I recall @oli-obk proposed such operations a while ago for a different purpose and I found the idea quite disgusting. ;) However, the code doing the casting might not even be aware that it is working on data stored in a global static, so it is unclear how such an API could even look like.
Cc @jonhoo

I think if there were annotations libraries like crossbeam could give to miri to get tracking to work in these situations, they would be happy to add those :) At least I would be!

Some time later, I don't think we have a proposal on the table that is better than asking the library for help. I am imagining an intrinsic like miri_ignore_leak_root or so that takes a pointer, and then the allocation that pointer points to gets added to the list of "roots" that Miri considers when checking if memory is still reachable on program termination (currently, that list consists of all the statics). @oli-obk any thoughts?
What I am not sure about is if the intrinsic should require the pointer to point to the beginning of the allocation -- I think for now I'd like to be as restrictive as possible and make this requirement.

We don't even need to burden rustc with an intrinsic. We can just use an extern "C" function (which also helps stable code, since it doesn't have to invoke an intrinsic). Basically users would write
#[cfg(miri)]
extern "C" { fn miri_ignore_leak_root(ptr: usize); }
#[cfg(miri)]
unsafe { miri_ignore_leak_root(some_ptr as usize); }

What I am not sure about is if the intrinsic should require the pointer to point to the beginning of the allocation -- I think for now I'd like to be as restrictive as possible and make this requirement.

I agree, we can emit a nice error stating the offset required to obtain a root pointer in order to help users quickly adjust their code to work without having to figure out an earlier site for obtaining the pointer.
If we feel really fancy we can make the leak checker emit a note at the first ptr2intcast site

We don't even need to burden rustc with an intrinsic. We can just use an extern "C" function (which also helps stable code, since it doesn't have to invoke an intrinsic).

Oh wow.^^ Now I wonder if we should have used that for miri_start_panic. ;)
I'd make the type a pointer type though, not usize.

https://github.com/rust-lang/miri/pull/1485 provides a solution to this: programs can call the extern "Rust" function miri_static_root to mark an allocation as being a root of static memory that should not be considered leaking when the program terminates.
@jonhoo if you could experiment with using that in crossbeam, that would be amazing. :)

@RalfJung That's exciting! Unfortunately I'm pretty swamped these days, but I posted a comment over in https://github.com/crossbeam-rs/crossbeam/issues/464#issuecomment-663077775 to see if I could pique some interest.

I'm working on triaging errors running crossbeam's test suite in Miri. For a typical leak report when using crossbeam-epoch, the only leaking allocations are for two different kinds of linked lists held by the global garbage collection context. Both of these data structures use crossbeam_epoch::Atomic, and the leak report misses these because they are behind a pointer-to-int conversion.
If I understand correctly, calling miri_static_root on entries as they are added would empty out the leak report, at the expense of possibly missing bugs if an entry were popped from the globally held lists and leaked instead of deallocated.
My other ideas, to avoid false negatives:

Conditionally add const pointer members to list entry data structures, update them after successfully updating the Atomic members, and never read them. Upon exit, the interpreter will be able to chase these extra pointers down the linked lists, and correctly ignore the entries. Downside: this will require adding conditional compilation blocks throughout the data structures, imposing some maintenance burden.
Add another extern fn to register an "atexit" callback, then add one conditional compilation block to call it, and within the callback, chase down the linked lists, calling miri_static_root on each entry. I'm not a big fan of this idea because it adds Turing completeness in a strange place, and I don't know what sort of weird issues would arise from trying to run code after the interpreter has exited main.

If I understand correctly, calling miri_static_root on entries as they are added would empty out the leak report, at the expense of possibly missing bugs if an entry were popped from the globally held lists and leaked instead of deallocated.

Correct.

Add another extern fn to register an "atexit" callback, then add one conditional compilation block to call it, and within the callback, chase down the linked lists, calling miri_static_root on each entry. I'm not a big fan of this idea because it adds Turing completeness in a strange place, and I don't know what sort of weird issues would arise from trying to run code after the interpreter has exited main.

Such a mechanism already exists (at least per-thread) since Miri implements TLS dtors run on thread exit.


Linter tool document update: add R4004.

Latest improvements:
MSFT employees can try out our new experience at OpenAPI Hub  - one location for using our validation tools and finding your workflow.

Contribution checklist:

[ ] I have reviewed the documentation for the workflow.
[ ] Validation tools were run on swagger spec(s) and have all been fixed in this PR.
[ ] The OpenAPI Hub was used for checking validation status and next steps.

ARM API Review Checklist

[ ] Service team MUST add the "WaitForARMFeedback" label if the management plane API changes fall into one of the below categories.
adding/removing APIs.
adding/removing properties.
adding/removing API-version.
adding a new service in Azure.

Failure to comply may result in delays for manifest application. Note this does not apply to data plane APIs.

[ ] If you are blocked on ARM review and want to get the PR merged urgently, please get the ARM oncall for reviews (RP Manifest Approvers team under Azure Resource Manager service) from IcM and reach out to them.
Please follow the link to find more details on API review process.

/azp run automation - sdk

Conflicting files

/azp run automation - sdk

Conflicting files

resolved

/azp run automation - sdk

/azp run automation - sdk

/azp run automation - sdk

/azp run automation - sdk


create meshmodel helper

Notes for Reviewers
This PR fixes  https://github.com/meshery/meshery/pull/7299#issuecomment-1458568931
Signed commits

[X] Yes, I signed my commits.

Codecov Report
Patch coverage has no change and project coverage change: -4.24 :warning:

Comparison is base (958a787) 16.47% compared to head (89455b9) 12.23%.

:mega: This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7314      +/-   ##
==========================================
- Coverage   16.47%   12.23%   -4.24%
==========================================
  Files         118      118
  Lines       16300    16300
==========================================
- Hits         2685     1995     -690
- Misses      13128    13983     +855
+ Partials      487      322     -165

Flag
Coverage Δ

gointegrationtests
?

unittests
12.23% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files
Coverage Δ

mesheryctl/internal/cli/root/system/status.go
1.51% <0.00%> (-53.79%)
:arrow_down:

mesheryctl/internal/cli/root/system/start.go
1.53% <0.00%> (-53.69%)
:arrow_down:

mesheryctl/internal/cli/root/system/stop.go
2.00% <0.00%> (-46.50%)
:arrow_down:

mesheryctl/internal/cli/root/system/update.go
1.65% <0.00%> (-42.98%)
:arrow_down:

mesheryctl/internal/cli/root/system/logs.go
4.00% <0.00%> (-42.67%)
:arrow_down:

mesheryctl/internal/cli/root/system/restart.go
2.66% <0.00%> (-42.67%)
:arrow_down:

mesheryctl/internal/cli/root/root.go
25.49% <0.00%> (-40.20%)
:arrow_down:

mesheryctl/internal/cli/root/version.go
0.00% <0.00%> (-34.19%)
:arrow_down:

mesheryctl/internal/cli/root/system/check.go
1.53% <0.00%> (-24.75%)
:arrow_down:

mesheryctl/internal/cli/root/error.go
0.00% <0.00%> (-20.00%)
:arrow_down:

... and 2 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

@leecalcote @Revolyssup

nil checking multiple places vs nil checking once. We have multiple producers and one consumer.

It's not a "vs" case. We have to nil check err at most of the producing points. Adding the same to consumer will reduce 2 line of visible code and add an extra a nil check everywhere else.

No. Abs() uses working directory in that case. The working directory is /server/cmd.
Abs() will return /server/cmd/components. do filepath.Abs(filepath.Join("../meshmodel","components"))

So sorry for this blunder. I'll fix it right away. Instead of using join, "../meshmodel/components" would also work exactly the same I think.

nil checking multiple places vs nil checking once. We have multiple producers and one consumer.

It's not a "vs" case. We have to nil check err at most of the producing points. Adding the same to consumer will reduce 2 line of visible code and add an extra a nil check everywhere else.

what is meant by "have to nil check at producers?". Producers do not know how those errors are going to be used. There job shouldn't be to do checks. This will be code duplication at multiple places for no reason. The consumer is responsible for doing something with that error and error nil check should be done as close to calling methods on that error as possible to avoid unnecessary panics. Why to enforce any nil check on producer side? You would effectively create a channel where "only non-nil errors should be passed" with no enforcement of this rule at runtime or compile time. It's just left to the programmer to figure out. Why to have such implicit rules? Make things explicit by not caring whether errors are nil or non-nil and passing them on the channel. At one point, at one place, the nil check will take place.

what is meant by "have to nil check at producers?". Producers do not know how those errors are going to be used. There job shouldn't be to do checks.

To check whether an error has occurred or not, we have to check if err is nil or not that is what is meant by "have to nil check at producers".

This will be code duplication at multiple places for no reason.

Adding the same to consumer will reduce 2 line of visible code and add an extra a nil check everywhere else.

The consumer is responsible for doing something with that error and error nil check should be done as close to calling methods on that error as possible to avoid unnecessary panics. Why to enforce any nil check on producer side? You would effectively create a channel where "only non-nil errors should be passed" with no enforcement of this rule at runtime or compile time. It's just left to the programmer to figure out. Why to have such implicit rules? Make things explicit by not caring whether errors are nil or non-nil and passing them on the channel. At one point, at one place, the nil check will take place.

Entire code is left to the programmer to figure out. I can put in the nil check at the consumer too if you want, it'll make sure that no nil but just notice that in most error case it'll check err twice.

what is meant by "have to nil check at producers?". Producers do not know how those errors are going to be used. There job shouldn't be to do checks.

To check whether an error has occurred or not, we have to check if err is nil or not that is what is meant by "have to nil check at producers".

This will be code duplication at multiple places for no reason.

Adding the same to consumer will reduce 2 line of visible code and add an extra a nil check everywhere else.

The consumer is responsible for doing something with that error and error nil check should be done as close to calling methods on that error as possible to avoid unnecessary panics. Why to enforce any nil check on producer side? You would effectively create a channel where "only non-nil errors should be passed" with no enforcement of this rule at runtime or compile time. It's just left to the programmer to figure out. Why to have such implicit rules? Make things explicit by not caring whether errors are nil or non-nil and passing them on the channel. At one point, at one place, the nil check will take place.

Entire code is left to the programmer to figure out. I can put in the nil check at the consumer too if you want, it'll make sure that no nil but just notice that in most error case it'll check err twice.

How are there two nil checks????????

How are there two nil checks???????? Do not check on producer. Only check at consumer. One nil check. What am I missing?

https://github.com/meshery/meshery/pull/7314/files#diff-ab4499e6d5cf39814e6b6dd3607e23566fe60b939e1bb2fbb068a832003046c4R55

https://github.com/meshery/meshery/pull/7314/files#diff-ab4499e6d5cf39814e6b6dd3607e23566fe60b939e1bb2fbb068a832003046c4R138

How are there two nil checks???????? Do not check on producer. Only check at consumer. One nil check. What am I missing?

https://github.com/meshery/meshery/pull/7314/files#diff-ab4499e6d5cf39814e6b6dd3607e23566fe60b939e1bb2fbb068a832003046c4R55
https://github.com/meshery/meshery/pull/7314/files#diff-ab4499e6d5cf39814e6b6dd3607e23566fe60b939e1bb2fbb068a832003046c4R138

Name the channel something like nonNilErrOnly. And leave the redundant err checking at consumer .  It's okay to have this much code duplication rather than having an accidental panic.

Name the channel something like nonNilErrOnly. And leave the redundant err checking at consumer . It's okay to have this much code duplication rather than having an accidental panic.

Understood. Leaving the renaming thing as is since we've decided to keep the nil check at consumer.

@Revolyssup  GTG

Syncing...


elfeed-search--faces: Search in alist, not tag order

When searching for faces that match a tag, keep the order of elfeed-search-face-alist, instead of the order of the tags on the entry. This allows one to properly apply faces to entries that have tag overlap.
I found myself in a situation where I had tags like fun, 9gag, comic, among others. I have feeds tagged fun and comic, feeds tagged comic, and feeds tagged fun and 9gag. Now, I'd like to color 9gag differently than other fun tagged feeds, and I want fun tagged feeds to have a preference over comic tags, when it comes to selecting a face.
So I set a specific order for my elfeed-search-face-alist:
(setq elfeed-search-face-alist
  '((unread elfeed-search-unread-title-face)
    (9gag algernon/elfeed-9gag-face)
    (fun algernon/elfeed-fun-face)
    (comic algernon/elfeed-comic-face)))

But elfeed-search--faces was iterating over the tags it received, and the order of the tags had no corellation with my fontification preferences:
(elfeed-search--faces '(9gag fun comic)) ;=> 9gag, fun, comic
(elfeed-search--faces '(comic fun 9gag)) ;=> comic, fun, 9gag

Instead of this behaviour, I'd rather see the function return the same thing in both cases, and follow the order in elfeed-search-face-alist.
The solution in this pull request is obviously slower, as it involves running over (arguably, short) lists a number of times, but I think the length of either list is likely to remain small enough that this should not cause significant slowdowns.
Nevertheless, I'll try my hands at optimising it, and will open a new PR if and when I manage to do so.

Merged as e53db40. I also updated the README to reflect the promised ordering (705f2ebc1d23a318df308cd59ba4fa6e3ef7a624).


Verifying requests with matchingJsonPath and equalToJson fails on null properties

Environment

Java 17
Gradle
JUnit 5.9.0
Wiremock JRE8 2.33.2
(reproducible also on wiremock 2.27.2 on kotlin/kotest)

Bug description
When verifying request body with matchingJsonPath and equalsToJson, test will fail if any properties within matched object are null.
This is most likely due to serialization options used in internal ObjectMapper used to compare those values: objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
Example test:
import com.github.tomakehurst.wiremock.client.WireMock;
import com.github.tomakehurst.wiremock.junit5.WireMockTest;
import org.junit.jupiter.api.Test;

import java.io.IOException;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;

import static com.github.tomakehurst.wiremock.client.WireMock.equalToJson;
import static com.github.tomakehurst.wiremock.client.WireMock.matchingJsonPath;
import static com.github.tomakehurst.wiremock.client.WireMock.post;
import static com.github.tomakehurst.wiremock.client.WireMock.postRequestedFor;
import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;
import static com.github.tomakehurst.wiremock.client.WireMock.verify;
import static java.net.http.HttpClient.newHttpClient;
import static java.net.http.HttpResponse.BodyHandlers.discarding;

@WireMockTest(httpPort = 8081)
public class WiremockBug {
    HttpClient httpClient = newHttpClient();

    @Test
    void test() throws IOException, InterruptedException {
        stubFor(post("/endpoint"));

        httpClient.send(
            postRequest("/endpoint", "{\"data\": {\"foo\": \"foo\", \"bar\": null}}"),
            discarding()
        );

        verify(1,
            postRequestedFor(WireMock.urlEqualTo("/endpoint"))
                .withRequestBody(
                    matchingJsonPath(
                        "data",
                        equalToJson("{\"foo\": \"foo\", \"bar\": null}")
                    )
                )
        );
    }

    private HttpRequest postRequest(String endpoint, String data) {
        return HttpRequest.newBuilder()
            .uri(URI.create("http://<IP_ADDRESS>:8081" + endpoint))
            .POST(HttpRequest.BodyPublishers.ofString(data))
            .build();
    }
}

Test output:
No requests exactly matched. Most similar request was:  expected:<
POST
/endpoint

data [equalToJson] {
  "foo" : "foo",
  "bar" : null
}> but was:<
POST
/endpoint

{
  "foo" : "foo"
}>

Reproduced, caused by the fact the matching code uses the same JSON parsing/serialising configuration as WireMock itself, which treats null values as equivalent to absent fields.

A possible solution to this would be to introduce an alternative parsing configuration for user data doesn't have this flag set.


Export labeled successful has corrupted geopackage

I'm raising this issue as a result of export 4d19a6bd-949d-48bc-8265-352c2146841
The geopackage of that export is corrupt: neither Geopandas or QGIS can read it. The shapefile is fine, though.
Looking at the json data for the export, under tasks, it lists the geopackage export as "status": "SUCCESS", despite to package being corrupted.
The export YAML config is:
planet_osm_point:
  types:
    - points
  select:
    - comment
    - description
    - note
    - source
    - fixme
    - FIXME
    - ele
    - name
    - ELE
    - NAME
    - place
    - population
  where:
    - place IS NOT NULL

The lower and upper case "fixme", "ele", and "name" tags were intentional. I'm not sure how case-sensitive various parts of OSM are, but there was specific reasons to suspect the export area had both cases used, so I included them just to be sure.
In the shapefile export, the fields were appended a _1, so there is for example ele and ELE_1 in the shapefile. I suspect the reason the geopackage is corrupted, is that the case sensitive fields maybe haven't been taken into account.

I'm not able to look at this immediately, but can you reproduce this issue using https://github.com/hotosm/osm-export-tool-python ? this is the library that performs the conversion from .osm XML to other formats

I can replicate this with osm_export_tool commandline. The export .yaml, input .osm, and output .gpkg are available here: export_debug.zip
Running
$ osm-export-tool chimpa.osm -m places.yaml chimpa

produces a corrupt geopackage file and this output:
ERROR 1: sqlite3_exec(CREATE TABLE "planet_osm_point" ( "fid" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "geom" GEOMETRY, "osm_id" INTEGER, "note" TEXT(80), "fixme" TEXT(80), "comment" TEXT(80), "population" TEXT(80), "FIXME" TEXT(80), "name" TEXT(80), "ele" TEXT(80), "NAME" TEXT(80), "ELE" TEXT(80), "place" TEXT(80), "description" TEXT(80), "source" TEXT(80))) failed: duplicate column name: FIXME
Completed in 0.053484439849853516 seconds.
gpkg {} gpkg.gpkg 72.00KB

So it considers fixme and FIXME to be the same column. The geopackage this creates has the same issues as the one I linked to earlier. QGIS can't open it. There's no error message in the UI, just refuses to load it when drag-and-dropping to the map canvas.

Great, so it seems like osm_export_tool_python should, when presented with duplicate fields taking case normalization into account, either:

reject the YAML configuration as invalid or
silently drop the duplicate field

One complicating factor is that OSM tags are case sensitive: the key FIXME is different than fixme, so when both are specified maybe it should take the first one and drop the second one.

Adding shapefile output as well:
$ osm-export-tool chimpa.osm -m places.yaml chimpa -f gpkg,shp

It produces this output:
Warning 6: Normalized/laundered field name: 'ele' to 'ele_1'
Warning 6: Normalized/laundered field name: 'FIXME' to 'FIXME_1'
Warning 6: Normalized/laundered field name: 'NAME' to 'NAME_1'
ERROR 1: sqlite3_exec(CREATE TABLE "planet_osm_point" ( "fid" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "geom" GEOMETRY, "osm_id" INTEGER, "ELE" TEXT(80), "ele" TEXT(80), "name" TEXT(80), "fixme" TEXT(80), "description" TEXT(80), "FIXME" TEXT(80), "NAME" TEXT(80), "place" TEXT(80), "population" TEXT(80), "comment" TEXT(80), "source" TEXT(80), "note" TEXT(80))) failed: duplicate column name: ele
Completed in 0.05878901481628418 seconds.
gpkg {} chimpa.gpkg 72.00KB
shp {'theme': 'planet_osm_point'} chimpa_planet_osm_point_points.shp,chimpa_planet_osm_point_points.shx,chimpa_planet_osm_point_points.prj,chimpa_planet_osm_point_points.cpg,chimpa_planet_osm_point_points.dbf 1.83KB

These "laundered" field names are used in creating the shapefile output, but seem not for the geopackage output for some reason. If OSM tags are in case sensitive, then I think the same tag name normalization could be applied to geopackages as well. I'd rather have weird field names than missing data.


Add authorization to the WCF Data export service

We've decided to use basic authentication and web.config as credentials store, at this moment.


No full example on how to automate this

We use templates to create new machines, and provisioning scripts to install everything on the VM. This documentation seems to assume one is OK with manual work every time a new machine is setup. I would like to see a guide that focus on doing all of this 100% automatically.

Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ID: 2036c044-4fbd-6016-c026-fea724b530d6
Version Independent ID: dde369ae-7a34-0753-5dfe-3720bf69e996
Content: Add a data disk to Linux VM using the Azure CLI - Azure Virtual Machines
Content Source: articles/virtual-machines/linux/add-disk.md
Service: virtual-machines-linux
Sub-service: disks
GitHub Login: @cynthn
Microsoft Alias: cynthn

Thanks for the feedback! We are currently investigating and will update you shortly.

Can you please elaborate on your ask for the document regarding automation? You can always select a disk while creating a VM using ARM template or from Azure portal

Is there an update? let me know.

We will now close this issue. If there are further questions regarding this matter, please tag me in a comment. I will reopen it and we will gladly continue the discussion.


Sonarqube Fixes

I ran this project through Sonarqube and it found a bunch of issues.  I have an automated solution for fixing issues.  As handling is added for fixing issues, I will submit the patches under this ticket.
If anyone would like access to the Sonarqube server with the scan results, please DM me and I will set you up.

There will be additional updates as the Honor Systems Updater is enhanced to handle more issues and scenarios.  As a result, I would suggest keeping this ticket open there will be additional commits under this topic.

Opened https://github.com/eclipse-ee4j/jaxb-ri/pull/1652 as it seems that this ticket can not be re-opened.


pdctl: add success response (#1600)

What problem does this PR solve?
Some pd-ctl commands do not have any output.
What is changed and how it works?
Show "Success!" like other commands.
Check List
Tests

Unit test
Integration test

/run-all-tests tidb=release-3.0 tikv=release-3.0 tidb-test=release-3.0

Travis CI failed due to VM out of memory. Merging.


No check for required inputs in New Item form

The New Item form does not check if there are values in any of the fields before writing to the database.

Relevant controller and model