Not able to get  localized translations for pt-br, en-gb, en-ie

Hi,
I'm new to romcal and trying to implement it in my app, it works fine overall but I can't get it to output the localized translations for the following locales : pt-br, en-gb, en-ie.
I tried to run the react-app from the examples folder locally and I get the same problem.
Here are the steps to reproduce:
cd .\react-app\
change package.json to avoid an error with node 18 (Error: error:0308010C:digital envelope routines::unsupported).
"scripts": {
    "start": "react-scripts --openssl-legacy-provider start"
...
}

then
yarn
then
yarn start
I see the romcal app in the browser, if I select any locale from the dropdown like en, fr, es, cs, it... it works fine:

But if I select  pt-br, en-gb or en-ie, I don't have the translations no matter the calendar selected:

Do you have any idea where it comes from?
Any help would be much appreciated.

Hello @LagoonProject! There is indeed a bug with locales composed with a dash (-). Thank you for reporting it!
I'll try to fix it in the following days.

Hello @LagoonProject! There is indeed a bug with locales composed with a dash (-). Thank you for reporting it! I'll try to fix it in the following days.

Thanks for your answer. I'm glad you identified the problem. I'll wait for the update then.

@LagoonProject, FYI this bug is now fixed. You have to upgrade all romcal dependencies to at least 3.0.0-dev.32.
And thank you for mentioning the now required --openssl-legacy-provider flag (to start the react app example). I'll also update the romcal examples as soon as I can 👍

@LagoonProject, FYI this bug is now fixed. You have to upgrade romcal + all romcal dependencies to at least 3.0.0-dev.32.
And thank you for mentioning the now required --openssl-legacy-provider flag (to start the react app example). I'll also update the romcal examples as soon as I can 👍

Thanks for the fast update. I should be able to test it very soon.
BTW you guys did an amazing job with romcal, very useful library that addresses a complex topic in a convenient way, I imagine a lot of work was put into it, congrats!


Add a filter debugger

Add a dialog that would allow one to "debug" template filters:

show a list of songs, together with info whether song matches or not.
for each filter tree node, show whether the selected song satisfies the node or not.

Not a standalone dialog as such, but a pane in DlgSongs that opens on specific command, takes DlgSongs' selection and displays the filter tree with color-coded match / non-match on each level of the tree.


benchmark: single x-axis tick

Sometimes, when workflows run fast, the x-axis has only one label, which is not enough to judge about the runtimes :wink:

Have you used -i 1 (interval of 1 minute for the plot) in analyze command? Default is 10 minutes and, indeed, it is not good for fast-running workflows.

Haven't set the interval manually... The issue is more about auto-discovering appropriate size in the default mode, e.g. what about checking max value and min value and divide in about ten bin and then round to some human-friendly amount, be it 10 seconds, 30 seconds, 1 minute, 5 minute, 10 minute, etc automatically?

I would prefer to keep manual intervals and, maybe, extend them (-i 1m - 1 minute, -i 30s - 30 seconds, etc.) in the future. But automatic discovery can be also done if you want to - your decision here.
In case we go with automatic discovery:

Do we keep the manual -i option or remove it?

Should the number of bins be a constant like 10? The number of bins is determined by how many can fit into the plot so it is probably some sort of constant if the size of the plot doesn't change.

WRT 1, automatic is better, and keeping -i for users so that they will be able to override the automatic defaults. This is basically how plotting tools work, e.g. try gnuplot and plot sin(x): if you don't specify axis intervals, some "automatic" ones are selected by the tool, so that the graph will be readable. But you can always overrride by specifying your own axis values and intervals.
WRT 2, it could be 5 if 10 is too much; anything aesthetically pleasing will do. Basically, if you discover that the test took 10 minutes, the suitable interval could be 2 minutes, and if it took 10 seconds, the suitable interval could be 2 seconds, so that there is always "about five" ticks on the time axis. Simplifies reading.
(This is all just cosmetics so that the plots would come out nicely "by default"...)


Add checkboxes to checklist widget #465

Description
After investigating i found out that checkboxes are not supported in widgets zou can find that there:
https://developer.android.com/guide/topics/appwidgets/
So instead of check boxes i added Image buttons which will appear in widget before text of checklist item. Image can be changed . I added mine just for test.
Also tried to implement some function on this button but its not working properly
Fixes #465
Type of change
Just put an x in the [] which are valid.

[ ] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ x] Breaking change (fix or feature that would cause existing functionality to not work as expected)

How Has This Been Tested?
Please describe the tests that you ran to verify your changes.

[ ] ./gradlew assembleDebug assembleRelease
[x ] ./gradlew checkstyle

Checklist:

[x] My code follows the style guidelines of this project
[x ] I have performed a self-review of my own code
[x ] 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

Can you add screenshots? and there are merge conflicts too

So there is screenshot dont think it suits appstyle so i didnt commit the png picture

Yeah i will try. was just busy


Test test_backends_no_config only in the quantum channel

Summary
Details and comments
Fixes #

Pull Request Test Coverage Report for Build<PHONE_NUMBER>

0 of 0   changed or added relevant lines in 0 files are covered.
No unchanged relevant lines lost coverage.
Overall coverage remained the same at 67.21%

Totals

Change from base Build<PHONE_NUMBER>:
0.0%

Covered Lines:
3421

Relevant Lines:
5090

💛  - Coveralls


[Bug]: shopify theme push isn't working on 3.59.0 again

Please confirm that you have:

[X] Searched existing issues to see if your issue is a duplicate. (If you’ve found a duplicate issue, feel free to add additional information in a comment on it.)
[X] Reproduced the issue in the latest CLI version.

In which of these areas are you experiencing a problem?
Theme
Expected behavior
Push changed files.
Actual behavior
Not pushing changed files.
Verbose output
https://pastebin.com/Yq4L6Kjz

(output was too long to open a ticket)

Reproduction steps

shopify theme push -e=env_name --allow-live

Operating System
Mac OS Ventura
Shopify CLI version (check your project's package.json if you're not sure)
3.59.0
Shell
zsh
Node version (run node -v if you're not sure)
v14.18.3
What language and version are you using in your application?
N/A

👋 hi @xmadscientist thank you for reporting this issue, would you mind rerunning the command you shared but with --verbose? we need this information in order to debug:
shopify theme push -e=env_name --allow-live --verbose
thank you for your help 🙏

Hi @mgmanzella,
When can we expect a fix? For our agency it's quite crucial to get the ignore file on point. Otherwise we are overwriting the content of our clients... Previously we used /(locales\/)(?!en-dev.default.json)/, but this doesn't seem to work anymore as well.

i don't have a time estimate on when this will be fixed, we're working through edge cases of glob matching being different in the TS implementation of theme push vs Ruby.
try using the --stable flag with your command, it should allow it to work as expected but let us know if it doesn't 🙏

Same problem here. This issue surfaced previously in 3.58.0 and was fixed in 3.58.2.
It seems that fix was reverted for some reason.

@xmadscientist Closing this issue since there is a workaround with the --stable flag
Feel free to re-open with more information and the full verbose log if needed!
For issues relating to your shopifyignore, please add to

#3749

Thanks :)


Hi,
It may be an oversight, but I see several script tags outside their respective dom-module.
AFAIK, code for the element registration must be enclosed within the  tag.
Could that be changed or would you accept a PR to change that?

Hi,
Can you please submit issues following the template laid out when you create a new issue. What problem are you observing? On which browsers? Screenshots of the issue?
Thanks.

It's funny, b/c again I did not get the template populated. Nevertheless here's the proper description:
Expected behavior and actual behavior:
IMO px-vis-spark.html shall use a local dom structure as outlined by the Polymer project. In a nutshell it's like:
<dom-module id="x-foo">

  <template>I am x-foo!</template>

  <script>
    Polymer({
      is: 'x-foo'
    });
  </script>

</dom-module>

In contrast to that px-vis-spark has a script-tag outside of the dom-module.
Steps to reproduce the problem:
Use the component in a browser that supports shadow dom and lazy load polymer.
Environment (component version number, Browser (including version), operating system, hardware, etc):
At least v0.2.3 and v1.0.0; I haven't checked others

My apologies, you are quite right. For some reason our templates seem to be missing from a few of our repos. We will rectify that ASAP.
Again, sorry and thank you for your issues.

Hi, It actually doesnt matter where the script tag is located. Although all the examples have the script inside the dom-module, the polymer docs state, "The


Another tweak to SonarQube.

Description
Trying to get Sonarqube PR scans to generate code coverage against the main (HEAD) branch to hopefully better guide us with our code coverage at the PR level.
Fixes # (issue)
Type of change
What is it?

[ ] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Documentation update
[ ] Tests update
[ ] Refactor

Checklist:

[ ] I have commented my code, particularly in hard-to-understand areas
[ ] I have made corresponding changes to the documentation
[ ] 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
[ ] I run make pre-commit to check fmt/vet/lint/test-no-fdo

Codecov Report
Base: 43.10% // Head: 43.15% // Increases project coverage by +0.04% :tada:

Coverage data is based on head (79b2c34) compared to base (5af2547).
Patch coverage: 73.33% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1716      +/-   ##
==========================================
+ Coverage   43.10%   43.15%   +0.04%
==========================================
  Files          69       69
  Lines        9632     9647      +15
==========================================
+ Hits         4152     4163      +11
- Misses       5048     5051       +3
- Partials      432      433       +1

Impacted Files
Coverage Δ

cmd/spec/main.go
0.00% <0.00%> (ø)

pkg/routes/imagesets.go
62.42% <78.57%> (+0.46%)
:arrow_up:

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.


Java port of vulkan-tutorial.com shows a black screen on specifically a AMD RX 6600

Version
3.3.1
Platform
Windows x64
JDK
jdk-<IP_ADDRESS>-hotspot
Module
Vulkan
Bug description
Hi,
I'm working on an extended version of the 'official' Java port of vulkan-tutorial.com. When swapping my AMD RX 570 for a AMD RX 6600, and running the code the (glfw) window remains black.
I've check a lot of stuff. Can anybody help me what to look for? Or reproduce and confirming the same issue?
When looking for or ruling out a possible cause, the following have been checked:

there are no errors reported.
the initial base chapters of the Java port. All giving me a black window.
the GPU is working. In use 10% looking at the task manager, and with vsync disabled (VK_PRESENT_MODE_IMMEDIATE_KHR) ramping up to 85%.
The original C++ version (https://vulkan-tutorial.com/code/15_hello_triangle.cpp) does work.
The demos on https://github.com/LWJGL/lwjgl3-demos/tree/main/src/org/lwjgl/demo/vulkan do work.
My two desktops (AMD Phenom II and Intel I5 10400) are giving the same result, swapping the GPU's, the RX6600 giving a black window on both machines with exact same software and versions on it.
reinstalling windows.
making sure latest releases are used.
Checked with the author of the code, but can't reproduce the issue on a Nvidea RTX 3080
changing the clearColor to blue, but still giving a black screen?!
Trying to align base code of almost the exact same output (a colored triangle), but in my learning curve no obvious issue is found.
issue: https://github.com/Naitsirc98/Vulkan-Tutorial-Java/blob/master/src/main/java/javavulkantutorial/Ch15HelloTriangle.java
working: https://github.com/LWJGL/lwjgl3-demos/blob/main/src/org/lwjgl/demo/vulkan/ColoredTriangleDemo.java
plugged the RX 570 in an not reinstalling any driver, the issue is gone!!!

My best guess it's a specific bug caused in mixture of something:

in the drivers for the new GPU architecture
combined with usage of LWJGL
the approach of vulkan methods in the source code.

Reproducible with the code on the url below (chapter Ch15HelloTriangle.java for instance)
https://github.com/Naitsirc98/Vulkan-Tutorial-Java/tree/master/src/main/java/javavulkantutorial
with latest releases:
VulkanSDK <IP_ADDRESS>
AMD drivers 22.11.2
jdk-<IP_ADDRESS>-hotspot
lwjgl 3.3.1
VSCode 1.74.1
Stacktrace or crash log output
No response

And using LWJGL nightly of today didn't fix it either.

plugged the RX 570 in an not reinstalling any driver, the issue is gone!!!

If I understand you correctly, this temporarily fixed the problem? So the issue comes and goes?

Looking through your code, I found some memory leaks in your code, which eventually lead me here:
Line 801 in org.lwjgl.system.MemoryStack:
public ByteBuffer UTF8(CharSequence text, boolean nullTerminated) {
        int  length = memLengthUTF8(text, nullTerminated);
        long target = nmalloc(POINTER_SIZE, length);
        encodeUTF8Unsafe(text, nullTerminated, target);
        return MemoryUtil.wrap(BUFFER_BYTE, target, length).order(NATIVE_ORDER);
    }

POINTER_SIZE is supposed to be either 4 or 8, however, when I cloned your project, and IntelliJ IDEA decompiled LWJGL, POINTER_SIZE is 1.

plugged the RX 570 in an not reinstalling any driver, the issue is gone!!!

If I understand you correctly, this temporarily fixed the problem? So the issue comes and goes?

yes indeed, the issue comes on the RX 6600 and goes with the RX 570

Hey @Trunkvv,
I just tried it on Windows, 3070 Ti with latest drivers. No issues, no warnings, everything renders correctly (at least Ch15 and Ch29).
Try reading back the framebuffer and writing it to an image on disk. Will tell you if it's an issue with the rendering or the presentation.

Hi @Spasi,
Thank you for trying on the 3070.
Good suggestion on reading the framebuffer.  In my noob learning curve; couple of hours spent trying to get it work. For writing to disk, I've found org.lwjgl.stb.STBImageWrite.stbi_write_png, but the data is required in ByteBuffer. But I'm very unsure (just after vkQueuePresentKHR) how to get an image (I've got the Long pointer)  into a ByteBuffer . Still investigating it, but maybe you have a hint?

@Trunkvv vkCmdCopyImageToBuffer

I'm learning here. Buffer is been taken care of.
But in the swapchain the present image has layout VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, so that's a no go to put in a buffer, as it requires VK_IMAGE_LAYOUT_GENERAL or VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL. Makes sense not to work with presentable layout.
So as you suggested,  my next challange would be to create my own image (+view)  and get it rendered to there.
To be continued.

As working with  pointers, I agree, already had some headaches working with it. We will see whether I'll manage to keep motivated on Vulkan with Java.

I assume the first primitive and value object previews will be available in Java 21, so development on LWJGL 4 may start then, which will likely use primitive types in place of typedefs and pointers. In the first versions of the primary Valhalla features, in C1, primitive types will treated as value objects, which will be normal reference types.

layout transfer? Good idea. I've transitioned the layout with a pipeline barrier, and copied it to a buffer. No validation errors anymore :-)
I'm still in the dark/horror about passing data from the buffer to STB, as the native stbi_write_png with JVM crashes. That will be the next challange.
Thanks for the support so far.

okay, got back on this one.
So I'm trying to read back the framebuffer and write it to an image on disk.
Hopefully it will tell me if it's an issue with the rendering or the presentation.
I've copied the image to a buffer with vkCmdCopyImageToBuffer. No errors so far.
But now I've come to a halt where I can't access a single byte of data on that buffer.
Could make sense. So for my learning curve, is this making sense and how to overcome it?
`
ByteBuffer dataAsByteBufferVulkan = pBufferAsPointerBuffer.getByteBuffer(0, 1);
// JVM crashes with EXCEPTION_ACCESS_VIOLATION:
dataAsByteBufferVulkan.get();
`

@Trunkvv
Use this as a reference:
VkDevice device = ...;
VkBufferCreateInfo creationInfo = ...;
long bufferSize = creationInfo.size();

final var contents = new float[] { ... };

try (final var stack = MemoryStack.stackPush()) {
    final var longPointer = stack.mallocLong(1);
    final var pointer = stack.mallocPointer(1);

    var resultCode = vkCreateBuffer(device, creationInfo, null, longPointer);
    if (resultCode != VK_SUCCESS) {
        throw new AssertionError(resultCode);
    }

    final var buffer = longPointer.get(0);

    final int requiredMemoryTypes = VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT;

    final var memoryRequirements = VkMemoryRequirements.malloc(stack);
    vkGetBufferMemoryRequirements(device, buffer, memoryRequirements);

    final var memoryProperties = VkPhysicalDeviceMemoryProperties.malloc(stack);
    vkGetPhysicalDeviceMemoryProperties(device.getPhysicalDevice(), memoryProperties);

    var memoryTypeIndex = -1;
    for (var i = 0; i < memoryProperties.memoryTypeCount(); ++i) {
        if (
                (memoryRequirements.memoryTypeBits() & (1 << i)) != 0 &&
                (memoryProperties.memoryTypes(i).propertyFlags() & requiredMemoryTypes) == requiredMemoryTypes
        ) {
            memoryTypeIndex = i;
            break;
        }
    }

    if (memoryTypeIndex == -1) {
        throw new RuntimeException();
    }

    final var allocationInfo = VkMemoryAllocateInfo.malloc(stack)
            .sType(VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO)
            .pNext(VK_NULL_HANDLE)
            .allocationSize(memoryRequirements.size())
            .memoryTypeIndex(memoryTypeIndex);

    resultCode = vkAllocateMemory(device, allocationInfo, null, longPointer);
    if (resultCode != VK_SUCCESS) {
        throw new AssertionError(resultCode);
    }

    final long memory = longPointer.get(0);

    vkBindBufferMemory(device, buffer, memory, 0);

    resultCode = vkMapMemory(device, memory, 0, bufferSize, 0, pointer);
    if (resultCode != VK_SUCCESS) {
        throw new AssertionError(resultCode);
    }

    final long data = pointer.get(0);

    final var dataLink = MemoryUtil.memFloatBuffer(data, contents.length);
    dataLink.put(0, contents, 0, contents.length);

    vkUnmapMemory(device, memory);

    // ...

    vkFreeMemory(device, memory, null);
    vkDestroyBuffer(device, buffer, null);
}

@ws909
thx! Adding a mapping to the  memory (vkMapMemory) helped out a lot.
Finally I'm able to write it to file now!  (Although the RGB channels of the transitioned frame buffer in VK_FORMAT_R8G8B8_SINT are not aligned correct with what stbi_write_png is expecting. But hey, I can recognize the image in the window, so now I can test it on the RX6600.
We will see tomorrow whether the issue lies in presentation or before.

okay, just tested on the RX6600. Just as on the RX570 I still can recognize the rendered image on disk. But the shown presented window is all black!
The presentation itself is a black box for me. What to look for?
Because the chosen swap surface format looks an available format from the device to me....

Well, found a workaround! I was looking at the difference of the working code:
https://github.com/LWJGL/lwjgl3-demos/blob/main/src/org/lwjgl/demo/vulkan/ColoredTriangleDemo.java
and not working on specifically my RX6600:
https://github.com/Naitsirc98/Vulkan-Tutorial-Java/blob/master/src/main/java/javavulkantutorial/Ch15HelloTriangle.java
ColoredTriangleDemo (lwjgl3-demos) is using the same queue family for graphics and presenting.
Ch15HelloTriangle (Vulkan-Tutorial-Java) allowed different families, and ended up select for present a different one with my RX6600. When I forced it to select the same as on the working demo, the issue with a presented black screen vanished!
So I don't know why it's presenting a black screen, but I made it disappear....

Anyone thinks it needs extra investigation?

@Trunkvv The Vulkan specification allows different queues for presentation and graphics, so if the example code fails in any way when these are not the same, you have either discovered a bug in the example code itself, or in the driver, or in the hardware.

Well, the RX570 does work with different graphics and presentation queue. The author does not have issues on the NV platform as well. I’ll leave it with that, it will indeed will have an issue in either the code, driver or hardware. It took me an awful lot of time to come to this point having a workaround to set the queues the same.
Thank you for your support during this investigation.

@Trunkvv Maybe this issue should be reported to AMD as a bug in their driver or hardware?

@ws909 Thanks, I've reported the issue with AMD.


Glow effect for focused candy buttons.

Candy buttons are very brightly colored, making it difficult to tell which one is currently focused. Even though it's a bright cyan color, this doesn't contrast significantly with bright yellow or bright red buttons, particularly for people who are colorblind.
I've added a pulsing animation to help the focused button stand out.
I gave CandyButtonDemo an opaque ColorRect background to reproduce layering problems which can arise in the game. I wanted this glow to go behind the button, but it's very difficult to do so. A naive approach is to set its Z-Index to 1 but this causes problems, which were not visible in CandyButtonDemo because it lacked a background.

Old:

New:

There is now a pulsing blue glow effect. I also made the text outline a little brighter.


Change name to IBM FHIR Server #114

Signed-off-by: Paul Bastide<EMAIL_ADDRESS>

I changed to ® for html encoding in the swagger/openapi generator.

both are easy fies


Play button not changing to show pause-icon when video is playing

Expected behaviour
The play button shows a pause-icon when media is playing.
Actual behaviour
The play button shows a play-icon regardless of media state.
Environment

Browser: Chrome 67, Edge 42, Firefox 60
Operating System: Windows 10
Version: 3.3.15

Steps to reproduce

Go to https://plyr.io/
Click play
Observe play button in lower left corner

It seems to be a tegression introduced in 3.3.15, 3.3.14 works.

Yeah, it was actually a fix for another issue which I think is non-fatal https://github.com/sampotts/plyr/commit/ea4d91d2a011cdfc835619cb90a25074c039e777#diff-21a888c55f507a76f2a82a75d300d6f7 Stay on  3.3.14 for now.
Thanks for reporting!

This is fixed in v3.3.16 - Sorry @friday I missed your change but ended up writing exactly the same code 👍

It seems this issue appears again in 3.4.0

Try the latest version


if DremioDaemon or AwsDremioDaemon are not visible in jps log resolutions steps but continue processing

transferred https://github.com/dremio/dremio-diagnostic-collector/issues/5


Kube 0.51

Trying to keep up-to-date with kube, the functionality that is hopefully landing in the next release will be pretty useful for the Krator watcher API.
https://github.com/clux/kube-rs/blob/master/CHANGELOG.md#unreleased


BCIP-0003: Wallet Key

I now think that this BCIP is about the connect method, shall we also decide on a key for each account? or do we just use a single key for all accounts when swapping (this is also fine) or we just address that in a different BCIP?

The BCIP-0002 should be updated to remove the root purpose and just reference to BCIP-0003 for that part, but should have coin_type from SLIP-44 and have unique keys pr. network.


Add Travis test with empty NODE_PATH

Since Travis tests run with NODE_PATH specified, it doesn't catch issues in code that does something wrong on empty NODE_PATH. We should add end-to-end tests for starting, building, and running tests with empty NODE_PATH.

This should be tackled in (this)[https://github.com/facebookincubator/create-react-app/blob/master/tasks/e2e-kitchensink.sh] file, right?


[Enhancement] Show more decimal places on balance

Description
Currently the Wallet only displays integer values, leaving out decimal places. At least this is what is happening with my balance which should be 0.0983 DARIC but is displayed as 0 DARIC:

I think it would be more beneficial to always show 2 decimal values inside the balance, since even a wallet with as low as 0.01 DSM can correctly perform any kind of transaction.

Fixed with #4


Open channel remote balance clarification

Since users have the possibility to set the remote balance, I think Juggernaut should make it extra clear of what remote balance means, otherwise users might not realise that they're actually sending sats to the other side when doing this.
Maybe it would actually make sense at a point in the future to not show some things in the UI, like the remote balance and target confirmations, unless the user enables an "Advanced" mode in settings.

Yeah, I think it's really important to push a few sats (1000 default) when opening a channel with messaging in mind.  If you do not push any sats then you cannot receive any messages.  1000 sats is small enough where it doesn't make sense for the remote node to close the channel to take the 1000 sats because most of it will be lost to on-chain fees.

I agree, 1000 sats is a good default and it's necessary.
The problem is that as the field is adjustable, and it's a source of confusion for people new to ⚡, an user might set a considerable larger amount (say, for example, half of the channel capacity) thinking that this would give him considerably more inbound liquidity, but not realising that he's actually sending the sats.
I think that's why other wallets chose not to show the field in the UI, while still having a 1000 sats default. If you want to have more than 1000, you can still have it, but you need to make an explicit send after opening the channel, which is not confusing even for people new to ⚡.


Add circleci 2.0

Codecov Report

Merging #3 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master       #3   +/-   ##
=======================================
  Coverage   94.61%   94.61%
=======================================
  Files           3        3
  Lines         130      130
=======================================
  Hits          123      123
  Misses          4        4
  Partials        3        3

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 786afa5...c4b8c1b. Read the comment docs.


Add framework support

Creats a root-level framework project that builds FLEX.framework
Adds FLEX shared scheme
Creates a root .xcworkspace to contain both the framework and example projects
Updates .travis.yml to build both framework and example project
Declares Carthage compatability in README

Nice! I'm out of the country traveling at the moment (and on very slow internet), but I'll have a look when I get back next week. Thanks for the PR!

Sorry for the delay! I've been without a computer for the last few weeks. Merged now. Thanks again!

No worries—thanks for merging this in and thanks for FLEX!


Fixing bug that's causing a fatal error in master pipeline.

This allows the pipeline to run, however I'm now running into other issues with the Crits-Christoph dataset not being able to run, but this is most likely due to files being deleted in the index directory. I expect this test to fail.

Oops, actually this test won't fail because it's using my index (one I made for testing) and not the one we use for running actual datasets


Update Latin-1 conversion table

Great list @Q726kbXuN that you compiled at glyph_counts.txt. Very interesting to see the frequency of unusual characters in NYT crosswords.
I dropped your list as-is into the code, but removed:

Glyphs from u0000-u00ff inclusive, since these are valid Latin-1, and
Emojis, since the encoder's replacements like \N{WINKING FACE} are as good as anything I could come up with.

So this is apparently every non-Latin-1, non-emoji character ever used in a NYT puzzle. A value of 'None' in the table causes the encoder to insert its own replacement. I put in conversions where I could think of something decent, but clearly this is more art than science so please feel free to edit. :)

Nice, thanks a ton for the work here, I'll (or anyone can, feel free!) to try and clean it up over time, but for now, it's a great start.


⚠ ClamAV has degraded performance

In 715fc2f, ClamAV (https://spamassassin.apache.org/) experienced degraded performance:

HTTP code: 200
Response time: 76 ms

Resolved: ClamAV performance has improved in c0f8534.


Fix prom service distributor version

Unfortunately that alone won't work to fix it as the value is hardcoded (in 0.7.4) to the old nats cluster address.
@StackScribe FYI as you're about to attempt to follow this PoC and this will stop you.
Let's wait until next version of Prom service is release as I can already see it contains the fix.
env:
  - name: PUBSUB_URL
     value: 'nats://keptn-nats-cluster'

Your change is only valid for Keptn 0.14.x. Prometheus-service does not yet have a 0.14.x compatible release.
Please note that the instructions on this page clearly state to use Keptn 0.13.5.

The changes you propose will break the tutorial for 0.13.x.


token-swap: Use checked math everywhere

Humans aren't smart enough to handle unchecked math

This was done with the release of v2


PreflightCheck Error

The code below emitted a error, because transpiled code with babel had no matching condition
if (check.match(/\/helpers\/(esm\/)?inherits/)) helpers = RUNTIME;
else if (~check.indexOf('function _inherits')) helpers = INLINE;
else if (~check.indexOf('babelHelpers')) helpers = EXTERNAL;
else {
	ctx.error(UNEXPECTED_ERROR);
}

babel version:  7.0.0-beta.47
the output code was
import _classCallCheck from "/path/to/node_modules/@babel/runtime/helpers/builtin/es6/classCallCheck";
import _inherits from "/path/to/node_modules/@babel/runtime/helpers/builtin/es6/inherits";
import _possibleConstructorReturn from "/path/to/node_modules/@babel/runtime/helpers/builtin/es6/possibleConstructorReturn";
import _getPrototypeOf from "/path/to/node_modules/@babel/runtime/helpers/builtin/es6/getPrototypeOf";

var Foo =
/*#__PURE__*/
function (_Bar) {
  function Foo() {
    _classCallCheck(this, Foo);

    return _possibleConstructorReturn(this, _getPrototypeOf(Foo).apply(this, arguments));
  }

  _inherits(Foo, _Bar);

  return Foo;
}(Bar);

;
export default Foo;

I tried babel 7.1.2, also got error

Could u paste in your rollup & babel configs?

Could you file an issue (or check if there is any already about it) in vue-cli repo? They have a little bit outdated dependencies - https://github.com/vuejs/vue-cli/blob/528c46507a21b76f12bc416d98f9b04c0076cb50/packages/%40vue/babel-preset-app/package.json#L24-L30
For the time being it seems that you should downgrade your rollup-plugin-babel to 4.0.0-beta.7

They had upgraded recently: https://github.com/vuejs/vue-cli/pull/2642
But even if I upgraded the babel, I still have this error. https://github.com/rollup/rollup-plugin-babel/issues/268 said preflightCheck will be removed，how long will it takes?

Could u prepare a repro case? What kind of an error do you see? What is the output code?

I made a minimal repo to reproduce:
git clone git@github.com:zsky/rollup-plugin-babel-issue267.git
cd rollup-plugin-babel-issue267
npm i
npm run build

Then outputed a error:
(babel plugin) Error: An unexpected situation arose.

I logged the code, the _inherits:
import _inherits from "@babel/runtime/helpers/es6/inherits";

The installed<EMAIL_ADDRESS>has still outdated babel dependencies.

I changed the babel config, set  useESModules false, solved my problem.


fixing missing block argument in sequence operator

Found this crash scenario. Apparently I had fixed this months ago and not submitted?

coverage: 88.863%. remained the same
when pulling ad4e51da905599aadc4099acf2b9d72a918834fb on doriantaylor:missing-block
into 989964c1a83af177ddbae521a054f2be5291df0c on ruby-rdf:develop.

Great, thanks! Have you noticed other places where a block is expected but not defined?

My examination shows a number of operators that don't have a block argument, but these are all for Update, rather than Query, so this seems the only one that needs to be addressed.

I didn't go looking for other missing blocks because I'm right in the middle of something but I can make a note to circle back and check later.


Cpp design docs

Cleanup todos surrounding Azure::Core
Add links to the clang-formating file

@CaseyCarter @JeffreyRichter  Please review.


Train on my own dataset

Hi, I wanna train my own dataset on this model, but I don't know how to make the dataset to a mat file. I do have Hyperspectral Images which are not in mat format. Could you tell me how to make them to mat files? Thanks  a lot!

If the format of Hyperspectral Images is TIF, you can  refer to the codes.


monetd default data directory path

Currently the data directory path for monetd is:

Linux - ~/.monet
Mac OS - ~/Library/MONET
Windows - ~/AppData/Roaming/MONET

While these are the correct locations, the name of the directory should be class case to remain within convention for Windows and Mac OS.
They should be renamed to:

Linux - ~/.monet
Mac OS - ~/Library/Monet
Windows - ~/AppData/Roaming/Monet

This is a single line change to src/configuration/const.go
The const defintion of MonetdTomlDirCaps in approx line 23.
It is a trivial change to make, but it is a breaking change for MacOS. Windows is case insensitive unless specifically changed to be so - and even then, it was only available since April 2018 (more here: https://www.howtogeek.com/354220/how-to-enable-case-sensitive-folders-on-windows-10/ )

Fixed in e22f9d8bb278377e2125bd18ccbe4cab8eaffa70


Save testium as a dev dependency

I presume that since testium is a dev/test scope tool that it'd be more appropriate as a devDependency? Close if I'm wrong! :D

Good point, thanks! :+1:

Yup!


CI compiler upgrade

Add GCC 9 + Clang 8
Task #10

Codecov Report

Merging #13 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master      #13   +/-   ##
=======================================
  Coverage   37.22%   37.22%
=======================================
  Files          11       11
  Lines         462      462
=======================================
  Hits          172      172
  Misses        290      290

Impacted Files
Coverage Δ

src/stacktrace.cpp
85.18% <ø> (ø)
:arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 69fff44...8da4bf4. Read the comment docs.


Documented dev_appserver start command doesn't work on linux

Out of the gcloud/appengine box on Linux, you have to include the .py extension.
dev_appserver.py .

Before I make a PR to change the README, I want to make sure that works on OSX/Windows (i.e. that they don't come with an extensionless shell script instead of a .py file).

This was most likely just my mistake, I'll fix it.


seat-groups revoking superadmin of user "admin"

Hi,
I have an issue after updating to the newest version, where it revokes my main admin account, which also has linked my main and all other alts.
This happens due to the missing token for the admin account, which I obviously cannot add.
I would just delete my main accounts and all alts and re-add them as alts of my main account to separate them, but due to other integrations (discord and discourse), I'd appreciate if I did not have to.
Has to be others who did the same thing as me when installing the SeAT application.
Is it possible that seat-groups can skip token checks for the hardcoded admin account?
Just to clarify;
The RefreshToken of admin is missing, therefore user group of My Main (admin, My Main, redacted alts) loses all permissions.

I REALLY can not stress enough where you should not be using the 'admin' user, and just a main account with linked alts.

The point of the issue opened is that the admin accounts token should not matter. I can live with any other tokens screwing with my roles. That's easily fixable.
I would revert it to having it separate, but that would also mean a lot of issues with other connected services, mainly everything tied to my main discourse account. If you have a proper method of separating out the admin account from being linked to the rest, I'm all ears though.
Something tells me updating the group_id field in users and user_settings might not be enough, as it's tied up with other tables. The last thing I wanna do is manually update the DB and break the instance because I missed a table. I have no idea if SeAT recognizes group_id 1 as admin, or if it's based on the username.

Hey @TyrHeimdal
Thank you for reporting this. Unfortunately it is not a bug but a configuration error you made by setting up your group. As @dysath explained you should never have the admin in your user group.
This was unfortunately able prior 3.0.5 but we hindered users to keep doing so.
I will not change the logic on SeAT Groups for a malconfiguration on yourside. Luckily there is a easy fix for this (or at least i hope so) :

Somehow (either via cli create the admin link, or via db) receive superuser permission
navigate to: /configuration/users
delete admin user from your user-group

@warlof confirmed this might work. If not you might try:
INSERT INTO groups (created_at, updated_at) VALUES (CURRENT_TIMESTAMP, CURRENT_TIMESTAMP);
UPDATE users SET group_id = (SELECT MAX(id) FROM groups) WHERE group_id = (SELECT group_id FROM users WHERE name = 'admin') AND name <> 'admin';
``` (made by warlof, thank you for supporting <3)

I hope this helps you?

Hey @herpaderpaldent
Bug or no bug, it was bugging me! Don't remember why it ended up that way, but everything was seemingly working fine - so I rolled with it (up until I ran into the issues after updating seat-groups).
Didn't want to bump the group_id without knowing how it would affect the existing information in other tables, and not knowing if admin was somehow hardcoded to gid 1 (makes sense to any Linux/UNIX, where "root" is just the name and you can't really screw with uid 0 as it's hardcoded in the kernel). My experience with Laravel is, unfortunately, very limited.
I took the approach of just rectifying the admin user by deleting it from my group and re-adding it with:
./artisan seat:admin:login
SeAT Admin Login URL Generator
User 'admin' does not exist. It will be created.
Searching for the 'Superuser' role
Checking if the Superuser role has the superuser permission
Adding the superuser permission to the role
Checking if 'admin' is a super user
Adding 'admin' to the Superuser role
Generating authentication token

Your authentication URL is valid for 60 seconds.
*REDACTED*

This worked out as intended.
Thanks for the assurances that deleting the admin user wouldn't screw up the instance. 👍 🥇

Perfect, glad we could work it out.


executor: initialize vhci early

We added initialize_vhci to all sandboxes so that we don't have
unused function warnings. We assumed it will fail silently,
but it fails loudly and crashes the whole machine on init,
so no fuzzing can happen with sandboxes other than none.
Initialize vhci earlier while we still have CAP_ADMIN.
As a nice side effect we now don't need to use syz_init_net_socket.

I am going to merge this now to repair syzbot instances. But if you have comments please post and I will fix.

lgtm. and sorry for breaking ;)


Sp 3478

Build Completed
:white_check_mark: This pull request has passed all validations.
Build Commands
ant -Dtestreports.dir=bin/reports/unit-test -f core/build.xml clean-all resolve jacoco && ant -f core/build.xml checkstyle publish-local

Cleanup Commands
rm -r ~/.ivy2/local || echo no publish local to remove

Changed files
  core/src/org/pentaho/di/core/row/value/ValueMetaBase.java

Unit test coverage change
These statistics help you identify how your changes have affected the coverage of the following files. If a file is not in this list, then its coverage was not affected by your changes. To get some help interpreting these metrics, please refer to Jacoco's documentation.
org.pentaho.di.core.row.value.ValueMetaBase

Branch Change:  + .32%
Complexity Change:  + .10%
Instruction Change:  + .28%
Line Change:  + .17%


Memory crash at String._bridgeToObjectiveCImpl()

I'll describe my crash with an example, looking for some insights into the reason why this is happening.
@objc public protocol LauncherContainer {
  var launcher: Launcher { get }
}

@objc public protocol Launcher: UIViewControllerTransitioningDelegate {
  func initiateLaunch(url: URL, launchingHotInstance: Bool)
}

@objc final class LauncherContainer: NSObject, LauncherContainer, TabsContentCellTapHandler {
...
  init(
    ...
  ) {
    ...
    super.init()
  }

  ...

  //
  // ContentCellTapHandler
  //
  public func tabContentCellItemDidTap(
    tabId: String
  ) {
    ...
    launcher.initiateNewTabNavigation(
      tabId: tabId      // Crash happens here
    )
}

public class Launcher: NSObject, Launcher, FooterPillTapHandler {
  public func initiateNewTabNavigation(tabId: String) {
     ...
  }
}

Crash stack last 2 lines are- libswiftCore.dylib swift_unknownObjectRetain libswiftCore.dylib String._bridgeToObjectiveCImpl()
String._bridgeToObjectiveCImpl() gets called when the caller and implementation is in Swift file
I believe due to @objc class LauncherContainer there'd be bridging header generated. Does that mean tabId passed to tabContentCellItemDidTap is a String but the one passed to initiateNewTabNavigation is NSString?
TabId is UUID().uuidString if that helps. Wondering if UUID().uuidString has something to do with this.

Thanks a ton for helping.

@phausler Sorry for proactively tagging you, thought you might be able to help me with the above question.

Apologies @NehaPundlik but I don't think this is the correct place for this question. I think the Apple Developer Forums, and including info like a crash log with a backtrace will help.


Add log_dict info in docs

What does this PR do?

Addressing https://github.com/PyTorchLightning/pytorch-lightning/discussions/12487#discussioncomment-2461429
for better communication about this method.
Does your PR introduce any breaking changes? If yes, please list them.

Before submitting

[ ] Was this discussed/approved via a GitHub issue? (not for typos and docs)
[ ] Did you read the contributor guideline, Pull Request section?
[ ] Did you make sure your PR does only one thing, instead of bundling different changes together?
[x] Did you make sure to update the documentation with your changes? (if necessary)
[ ] Did you write any new necessary tests? (not for typos and docs)
[ ] Did you verify new and existing tests pass locally with your changes?
[ ] Did you list all the breaking changes introduced by this pull request?
[ ] Did you update the CHANGELOG? (not for typos, docs, test updates, or internal minor changes/refactorings)

PR review
Anyone in the community is welcome to review the PR.
Before you start reviewing make sure you have read Review guidelines. In short, see the following bullet-list:

[x] Is this pull request ready for review? (if not, please submit in draft mode)
[x] Check that all items from Before submitting are resolved
[x] Make sure the title is self-explanatory and the description concisely explains the PR
[x] Add labels and milestones (and optionally projects) to the PR so it can be classified

Did you have fun?
Make sure you had fun coding 🙃
cc @borda @rohitgr7

Thank everyone


accessToken support?

I was wondering if pyodbc will support connecting to an Azure SQL DB using the AD access token instead of user/password?

Unfortunately I don't think so without some code changes
The ODBC connection string is passed as-is to the driver, so companies can support any keywords they want.  Unfortunately MS didn't do the easy, obvious thing and allow an "accessToken=xyz" keyword in the connection string, at least as far as I can tell.
This indicate you need to set it as a connection attribute before connecting.  Unfortunately it also shows you need to pass a binary structure (thanks MS!) which pyodbc does not support yet.
I could add this constant and recognize it as a pointer type, but it would probably be better to come up with Python data type that is known to be passed as a pointer (SQL_IS_POINTER).  In Python 3, bytes would be a natural choice, but I'm not sure what I'd use in Python 2.  buffer?  Perhaps ctypes?
SQL_COPT_SS_ACCESS_TOKEN = 1256
token3 = b'...'
pyodbc.connect("Driver={..};Database=xyz", attrs_before={
   SQL_COPT_SS_ACCESS_TOKEN: token
})

Encoding the token properly would require using the struct module, but I think an example would make it tolerable.

Unfortunately MS didn't do the easy, obvious thing and allow an "accessToken=xyz" keyword in the connection string, at least as far as I can tell.

The access token is usually very long (>1KB, and several KB is not uncommon), can contain arbitrary data, and driver managers may have hardcoded limits on how long a connection string may be. Even pyodbc currently has hardcoded limit of 600 (why? A quick glance through the code doesn't reveal any fixed-length buffers.)
This page describes how to use an access token. I believe bytes would be OK for Python 2 as well, despite the fact that it is not really a string, or perhaps bytearray for 2.6+ . I will look into trying to add this.

Give this a try... https://github.com/v-chojas/pyodbc/tree/connattrs
I implemented the following type mapping:

Python object
Value type

buffer(2.x)
SQL_IS_POINTER

bytearray(>=2.6)
SQL_IS_POINTER

bytes(2.x)
string length

bytes(3.x)
SQL_IS_POINTER

integers
SQL_IS_INTEGER or SQL_IS_UINTEGER depending on sign

unicode
string length

This works with AAD access tokens. Example code to expand the token and prepend the length as described on the page linked above, in Python 2.x:
token = "eyJ0eXAiOi...";
exptoken = "";
for i in token:
 exptoken += i;
 exptoken += chr(0);
tokenstruct = struct.pack("=i", len(exptoken)) + exptoken;
conn = pyodbc.connect(connstr, attrs_before = { 1256:bytearray(tokenstruct) });

3.x is only slightly more involved due to annoying char/bytes split:
token = b"eyJ0eXAiOi...";
exptoken = b"";
for i in token:
 exptoken += bytes({i});
 exptoken += bytes(1);
tokenstruct = struct.pack("=i", len(exptoken)) + exptoken;
conn = pyodbc.connect(connstr, attrs_before = { 1256:tokenstruct });

(SQL_COPT_SS_ACCESS_TOKEN is 1256; it's specific to msodbcsql driver so pyodbc does not have it defined, and likely will not.)

Hi! Something new about this issue? Could anyone merge the connattrs to master?

also interested having this feature, any news?

It's waiting for https://github.com/mkleehammer/pyodbc/pull/259 to be merged.

The #259 has been merged, this issue can be closed now.
@adw555 @Pcosmin @hexadite-idan  you can try this now in pyODBC 4.0.24.

Give this a try... https://github.com/v-chojas/pyodbc/tree/connattrs
I implemented the following type mapping:
Python object	Value type
buffer(2.x)	SQL_IS_POINTER
bytearray(>=2.6)	SQL_IS_POINTER
bytes(2.x)	string length
bytes(3.x)	SQL_IS_POINTER
integers	SQL_IS_INTEGER or SQL_IS_UINTEGER depending on sign
unicode	string length
This works with AAD access tokens. Example code to expand the token and prepend the length as described on the page linked above, in Python 2.x:
token = "eyJ0eXAiOi...";
exptoken = "";
for i in token:
 exptoken += i;
 exptoken += chr(0);
tokenstruct = struct.pack("=i", len(exptoken)) + exptoken;
conn = pyodbc.connect(connstr, attrs_before = { 1256:bytearray(tokenstruct) });

3.x is only slightly more involved due to annoying char/bytes split:
token = b"eyJ0eXAiOi...";
exptoken = b"";
for i in token:
 exptoken += bytes({i});
 exptoken += bytes(1);
tokenstruct = struct.pack("=i", len(exptoken)) + exptoken;
conn = pyodbc.connect(connstr, attrs_before = { 1256:tokenstruct });

(SQL_COPT_SS_ACCESS_TOKEN is 1256; it's specific to msodbcsql driver so pyodbc does not have it defined, and likely will not.)

This particular reply from @v-chojas really helped me to succeed in getting token based access to the database.  Listed below you will find an alternative implementation for creating the tokenstruct. It takes a (Python 3) string as input. This works for Python 3.5+, otherwise you will have to remove the type annotations or convert them to comments.
As you can see, I changed the struct.pack parameter to "<i" following the line of reasoning that if you encode the characters Little-Endian, you will probably want to code the length as well Little-Endian.
def str2mswin_bstr(value: str) -> bytes:
    """Convert a string to a (MS-Windows) BSTR.

    See https://github.com/mkleehammer/pyodbc/issues/228#issuecomment-319190980
    for the original code (although the input in that example are bytes,
    assumed to contain characters in the range 0..255).  It appears the string
    is converted to an MS-Windows BSTR in 'Little-endian' format.

    Please note that this routine (nor the original code) will produce correct
    output if any code point in the input string is not in the ISO/IEC 10646
    Basic Multilingual Plane (BMP), assuming the resulting structure is
    expected to hold UCS-2 characters.

    See https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-dtyp\
       /692a42a9-06ce-4394-b9bc-5d2a50440168
    for more info on BSTR.  It does not state however what kind of encoding
    it contains.

    See https://en.wikipedia.org/wiki/Universal_Coded_Character_Set for info
    on UCS-2.

    :param value: the string to convert
    :return: the converted value
    """
    # The original code from the provided github URL applies 'Little-endian'
    # to the character conversion in a python for-loop.
    # The following is much faster and works safely for the whole ASCII range.
    # BTW, there is no Byte Order Mark (BOM) inserted when specifying an
    # explicit endianness.
    encoded_bytes = value.encode("utf_16_le")
    # The original code applies native endianness for encoding the length
    # prefix. My working assumption that also the length should be encoded
    # 'Little-endian', regardless of the CPU (and OS) this code is running on.
    return struct.pack("<i", len(encoded_bytes)) + encoded_bytes

In due time, I will provide this function as a small utility package in PyPI.

There is no guarantee that values in an access token will be ASCII.
The correct specification of the token is in the TDS protocol:
https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-tds/f40cca29-29b8-43ec-b9ff-2f8682486c29

The client then generates and sends a tokenless Federated Authentication Token message that contains binary authentication data that is generated by the federated authentication library.

https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-tds/827d9632-2957-4d54-b9ea-384530ae79d0

Ooh, that's interesting!
First of all - for completeness' sake - I regrettably have to withdraw my statement that I got it working. I didn't check thoroughly enough. Still working on it...
But regarding your remark about binary authentication data, if the token could be binary, how is it possible that MSIAuthentication provides me a token (om Python 3.6) of type str?
I use the following code fragment to get the token that I'm passing as the value parameter in the function listed above:
    credentials = MSIAuthentication(resource="https://database.windows.net/")
    access_token = credentials.token["access_token"]

access_token has type str (not bytes). I think it is impossible to encode an arbitrary binary in a py3 str type.
[But perhaps I'm using the wrong code to obtain the token...]

The fact that an access-token-producing API is only producing ASCII tokens does not mean that consumers of tokens can assume that they are, given that this is a very generic authentication method. Or put another way, ASCII-only is just a subset of binary.
Also, note that msodbcsql17 since 17.3 supports MSI authentication itself:
https://docs.microsoft.com/en-us/sql/connect/odbc/using-azure-active-directory
(Use Authentication=ActiveDirectoryMSI in the connection string, and optionally for a user-assigned identity, set the UID to the object ID.)

The fact that an access-token-producing API is only producing ASCII tokens does not mean that consumers of tokens can assume that they are, given that this is a very generic authentication method. Or put another way, ASCII-only is just a subset of binary.

In fact you are absolutely right about that. The producing API I am using (i.e. MSIAuthentication) returns a str however, which means that I have to encode the returned string into a binary blob if I change my conversion function into something that consumes bytes instead of str. Looking at the contents of the string (looks a bit like a base-64 encoding) my guess is that indeed 'ascii' is probably the best encoding to choose.
And this approach is working now (in a (Linux) Docker container)!
Having said all this, the earlier listed conversion function can be replaced by the following one, which is about a factor of 13 faster:
def bytes2mswin_bstr(value: bytes) -> bytes:
    """Convert a sequence of bytes into a (MS-Windows) BSTR (as bytes).

    See https://github.com/mkleehammer/pyodbc/issues/228#issuecomment-319190980
    for the original code.  It appears the input is converted to an
    MS-Windows BSTR (in 'Little-endian' format).

    See https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-dtyp\
       /692a42a9-06ce-4394-b9bc-5d2a50440168
    for more info on BSTR.

    :param value: the sequence of bytes to convert
    :return: the converted value (as a sequence of bytes)
    """
    # The original code from the provided github URL applies 'Little-endian'
    # to the byte conversion in a python for-loop.
    # The following is code is assumed to be faster.
    encoded_bytes = bytes(chain.from_iterable(zip(value, repeat(0))))
    # The original code applies native endianness for encoding the length
    # prefix. My working assumption that also the length should be encoded
    # 'Little-endian', regardless of the CPU (and OS) this code is running on.
    return struct.pack("<i", len(encoded_bytes)) + encoded_bytes

Do you agree that also the length should be encoded 'Little-endian', regardless of the CPU (and OS) this code is running on?

Also, note that msodbcsql17 since 17.3 supports MSI authentication itself:
https://docs.microsoft.com/en-us/sql/connect/odbc/using-azure-active-directory
(Use Authentication=ActiveDirectoryMSI in the connection string, and optionally for a user-assigned identity, set the UID to the object ID.)

I have not tried this out, nor do I intend to (a bit frightened by the Note about MacOS and Linux support), now that I have it working.
But thanks again for this solution and your support! :-)

Do you agree that also the length should be encoded 'Little-endian', regardless of the CPU (and OS) this code is running on?

The only platforms that the ODBC Driver for SQL Server is available on are LE.

I am having issues connecting via pyodbc with app-registration credentials.
import pyodbc
import struct

# credentials generated by app-registration
USER = "XXXXXXXXXXXXXXXXXX"
PW = "XXXXXXXXXXXXXXXXXX"

database_url = "https://database.windows.net/"

authority_url = "https://login.microsoftonline.com"
tenantId = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
authority_url = authority_url + "/" + tenantId

context = adal.AuthenticationContext(authority_url, api_version=None)

token = context.acquire_token_with_client_credentials(
    database_url,
    USER,
    PW
)
print(token)

tokenb = bytes(token["accessToken"], "UTF-8")

exptoken = b''
for i in tokenb:
    exptoken += bytes({i})
    exptoken += bytes(1)
tokenstruct = struct.pack("=i", len(exptoken)) + exptoken
tokenstruct

SQL_COPT_SS_ACCESS_TOKEN = 1256
CONNSTRING = "DRIVER={};SERVER={};DATABASE={}".format("ODBC Driver 17 for SQL Server", SERVER, DATABASE)

conn = pyodbc.connect(CONNSTRING, attrs_before = { SQL_COPT_SS_ACCESS_TOKEN:tokenstruct })

cursor = conn.cursor()
cursor.execute(QUERY)
row = cursor.fetchone()```

The token is generated (`accessToken` below):

```{'tokenType': 'Bearer', 'expiresIn': 3600, 'expiresOn': '2019-06-27 10:36:58.175894', 'resource': 'https://database.windows.net/', 'accessToken': 'XXXXXXXXXXXXXXXXXXXXXXXXXX', 'isMRRT': True, '_clientId': 'XXXXXXXXXXXXXXXXXXXXXX', '_authority': 'https://login.microsoftonline.com/XXXXXXXXXXXXXXX'}

But I get this error when trying to make connection:
 conn = pyodbc.connect(CONNSTRING, attrs_before = { SQL_COPT_SS_ACCESS_TOKEN:tokenstruct })
pyodbc.InterfaceError: ('28000', "[28000] [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Login failed for user ''. (18456) (SQLDriverConnect)")

or, from a Windows machine:
    conn = pyodbc.connect(CONNSTRING, attrs_before = { SQL_COPT_SS_ACCESS_TOKEN:tokenstruct })
pyodbc.InterfaceError: ('28000', "[28000] [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Login failed for user 'NT AUTHORITY\\ANONYMOUS LOGON'. (18456) (SQLDriverConnect); [28000] [Microsoft][ODBC Driver 17 for SQL
Server][SQL Server]Login failed for user 'NT AUTHORITY\\ANONYMOUS LOGON'. (18456)")

In my case, the solution was explained here, but basically, my SQL admin had to add permissions for the app-registration to the specific database that I was trying to access.

There is lot of communication happened in the thread, however, it is very difficult to come to conclusion based on the above errors, here you go a full working code:
Python 2.x:
Using sqlalchemy
from sqlalchemy import create_engine
from flask import Flask
import urllib
import requests
import struct
Retrieve token
headers = {'Metadata': 'true'}
params = {('api-version', '2018-02-01'), ('resource', '$your_token_resouce')}
response = requests.get('http://169..../metadata/identity/oauth2/token', headers=headers, params= params)
token = response.json().get('access-token')
token = token.encode('utf-8')
exptoken = ""
for i in token:
exptoken += i
exxptoken += chr(0)
tokenstruct = struct.pack("=i", len(exptoken)) + exptoken;
CONNSTRING = "DRIVER={"+yourdriver+"};SERVER="+your_server+"DATABASE="+your_database+";Authentication=ActiveDirectoryMsi"
params = urllib.quote_plus(CONNSTRING)
db = create_engine('mssql+pyodbc:///?odbc_connect=%s" %params, connect_args={'attrs_before': {1256: bytearray(tokenstruct)})
conn = db.connect()
result = conn.execute("your sql")
rows = [row[0] for row in result]
print rows

CONNSTRING is main issue, and you need to carefully construct it
you can implement it using pyodbc as well, please message if you still have problems

I have tried to do a variant of the preceding.   First in a terminal, I log in to our Azure environment.  Then I create a python script whose purpose is to access one of our Azure SQL db's and do some processing.
Since we have multi-factor auth I need a token as well as user credentials.  The python script begins by executing a CLI command to get a token.
command = "az account get-access-token --resource https://xxx.database.windows.net"
token = subprocess.check_output(command, shell=True)

The access token that gets returned is a <class 'bytes'> with a length of 1942.  Since it's a 'bytes' class I didn't think I'd have to further encode it?  That said, if I take the access token returned by 'az account get-access-token ...' and pass it into the following the process simply times out.
driver= 'ODBC Driver 17 for SQL Server'
server = 'xxx.database.windows.net'
database = 'tenant_stats'
username = '{xxx@xxx}'
password = '{.. xxx ..}'
url = 'DRIVER={' + driver + '};SERVER=' + server + ';DATABASE=' + database + ';UID=' + username + ';PWD=' + password + ';Authentication=ActiveDirectoryPassword;'

SQL_COPT_SS_ACCESS_TOKEN = 1256

conn = pyodbc.connect(url, attrs_before = { SQL_COPT_SS_ACCESS_TOKEN:token })
cursor = conn.cursor()

I seem to be doing what has been suggested except for the tokenstruct creation.  Any thoughts or guidance would be appreciated.

except for the tokenstruct creation

Yes, you need to pass the token in the correct format to the driver, which includes prepending a length field and expanding the bytes with 0-padding if necessary.

@v-chojas Yeah, I tried this from @michaelcapizzi.:
tokenb = bytes(token, "UTF-8")

exptoken = b''
for i in tokenb:
    exptoken += bytes({i})
    exptoken += bytes(1)
tokenstruct = struct.pack("=i", len(exptoken)) + exptoken
tokenstruct

SQL_COPT_SS_ACCESS_TOKEN = 1256

conn = pyodbc.connect(url, attrs_before = { SQL_COPT_SS_ACCESS_TOKEN:tokenb })

cursor = conn.cursor()

It ends the same way ie. login timeout

Have you got the accessToken from sql paas?
On Wed, Mar 11, 2020 at 9:08 PM MikeB2019x<EMAIL_ADDRESS>wrote:

@v-chojas https://github.com/v-chojas Yeah, I tried this from
@michaelcapizzi https://github.com/michaelcapizzi.:
tokenb = bytes(token, "UTF-8")
exptoken = b''
for i in tokenb:
exptoken += bytes({i})
exptoken += bytes(1)
tokenstruct = struct.pack("=i", len(exptoken)) + exptoken
tokenstruct
SQL_COPT_SS_ACCESS_TOKEN = 1256
conn = pyodbc.connect(url, attrs_before = { SQL_COPT_SS_ACCESS_TOKEN:tokenb })
cursor = conn.cursor()
It ends the same way ie. login timeout
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/mkleehammer/pyodbc/issues/228#issuecomment-597879446,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AA6H6WFBGV56TTY26AHLNO3RG74VTANCNFSM4DHRUILQ
.

--
Thanks & Regards,
Sivagopal.B

Check that your access token structure is in the correct format, you can hexdump it to verify; e.g. if it was 1942 bytes before the expansion, and began with "eyJ0e...", then it should be 3884 after and the token structure should start with 2C 0F 00 00 65 00 79 00 4A 00 30 00 65 00 ...
Also, do not specify UID, PWD, nor Authentication when using an access token - the access token is the credential to access the database, and the only one you need.

@sivagopal I have the access token.  I use the following to get it:
command = "az account get-access-token --resource https://ossrdbms-aad.database.windows.net"
response = subprocess.check_output(command, shell=True)
token = json.loads(response)['accessToken']
print(len(token))

The length of the 'reponse' is 1942.  I see that the 'response' is an object with an attribute 'accessToken' but also others such as 'tenant' and 'expiresOn'.  I've assumed I just need the 'accessToken'.  The length of 'token' is 1738 and it begins with 'eyJ0...' .
@v-chojas after the expansion loop the length is 3480.  So:
1738
eyJ0eXAiOiJK ...

And after expansion:
3480
b'\x94\r\x00\x00e\x00y ...

Does that look right?  In either case the login fails.  If I include UID/PSSWD the error is:
Error: ('01000', "[01000] [unixODBC][Driver Manager]Can't open lib<EMAIL_ADDRESS>: file not found (0) (SQLDriverConnect)")

If I don't include UID/PSSWD the error is as follows which looks like it doesn't recognize the user(?!):
InterfaceError: ('28000', "[28000] [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Login failed for user ''. (18456) (SQLDriverConnect)")

This seems very difficult for what I expected to be straightforward.  I greatly appreciate
the help :-)

You don't need uid and password. If the sql paas is based on managed
identity, if it is a static password basis, then you need to pass
authentication bearer, I can provide you an example if you are not sure
On Thu, 12 Mar 2020, 15:29 MikeB2019x<EMAIL_ADDRESS>wrote:

@sivagopal https://github.com/sivagopal I have the access token. I use
the following to get it:
command = "az account get-access-token --resource https://ossrdbms-aad.database.windows.net"
response = subprocess.check_output(command, shell=True)
token = json.loads(response)['accessToken']
print(len(token))
The length of the 'reponse' is 1942. I see that the 'response' is an
object with an attribute 'accessToken' but also others such as 'tenant' and
'expiresOn'. I've assumed I just need the 'accessToken'. The length of
'token' is 1738 and it begins with 'eyJ0...' .
@v-chojas https://github.com/v-chojas after the expansion loop the
length is 3480. So:
1738
eyJ0eXAiOiJK ...
And after expansion:
3480
b'\x94\r\x00\x00e\x00y ...
Does that look right? In either case the login fails. If I include
UID/PSSWD the error is:
Error: ('01000', "[01000] [unixODBC][Driver Manager]Can't open lib<EMAIL_ADDRESS>: file not found (0) (SQLDriverConnect)")
If I don't include UID/PSSWD the error is as follows which looks like it
doesn't recognize the user(?!):
InterfaceError: ('28000', "[28000] [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Login failed for user ''. (18456) (SQLDriverConnect)")
This seems very difficult for what I expected to be straightforward. I
greatly appreciate
the help :-)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/mkleehammer/pyodbc/issues/228#issuecomment-598252167,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AA6H6WGGRT5UIX4Q4PMSALTRHD5W3ANCNFSM4DHRUILQ
.

assumed I just need the 'accessToken'

Correct.

after the expansion loop the length is 3480

If the token ('eyJ0...' string)  is 1738  bytes long, then expanding it should've resulted in 3476, and prepending the 4-byte length gets you to 3480, so if that's what you meant, it seems right to me.
Use a connection string with only Driver, Server, and Database when connecting using the access token. The token is supplied as a connection attribute so you should not supply any other credentials. The "login failed for user '' " suggests the driver might not be new enough to support access token; an invalid token usually gives "login failed for 'NT AUTHORITY\ANONYMOUS LOGON'". Make sure you are using latest version of the ODBC driver.

@siva - an example might be good.  When I run 'az account get-access...' the object returned has 'bearer', 'tenant', etc.  I have only be using 'accessToken' and didn't think the rest was required.
@v-chojas - I have the latest ODBC (17.5.1).  But about the length, if the length is 3480 then should that be the value for SQL_COPT_SS_ACCESS_TOKEN instead of 1256?
SQL_COPT_SS_ACCESS_TOKEN = 1256
conn = pyodbc.connect(url, attrs_before = { SQL_COPT_SS_ACCESS_TOKEN:tokenb })

1256 is the identifier of the connection attribute, not the length of the access token.
17.5.1 is not the latest but should be new enough for access token support.

I tried changing to "driver= '/usr/local/lib/libtdsodbc.so'" instead of "driver='ODBC Driver 17 for SQL Server'".  When using that I get:
OperationalError: ('08S01', '[08S01] [FreeTDS][SQL Server]Unable to connect: Adaptive Server is unavailable or does not exist (20009) (SQLDriverConnect)')

ODBC 17 Driver is good to go,,here is an example app I used:
headers = {"Metadata" : 'true'}
params = (('api-version', '2018-02-01'), ('resource', '
https://database.windows.net'))
response = requests.get('http://ipadress/metadata/identity/oauth2/token',
headers=headers, params= params)
token = response.json().get('access-token')
token = token.encode('utf-8')
now replace you token struct loop
CONNSTRING = "DRIVER=(ODBC Driver 17 for SQL Server);
SERVER=yourdatabaseserver; Authentication=ActiveDirectoryMsi (or specific
to your auth type, see azure documentation)"
params - urllib.quote_plus(CONNSTRING)\
DATABASE_URI="mssql+pyodbc://?odbc_connect=%s" % params
The above code works for me
On Fri, Mar 13, 2020 at 4:31 PM MikeB2019x<EMAIL_ADDRESS>wrote:

I tried changing to "driver= '/usr/local/lib/libtdsodbc.so'" instead of
"driver='ODBC Driver 17 for SQL Server'". When using that I get:
OperationalError: ('08S01', '[08S01] [FreeTDS][SQL Server]Unable to connect: Adaptive Server is unavailable or does not exist (20009) (SQLDriverConnect)')
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/mkleehammer/pyodbc/issues/228#issuecomment-598808295,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AA6H6WHKR3AWBRQT5VWA7T3RHJNURANCNFSM4DHRUILQ
.

--
Thanks & Regards,
Sivagopal.B

If I use:
exptoken = ""
for i in token:
    exptoken += i
    exptoken += chr(0)
    tokenstruct = struct.pack("=i", len(exptoken)) + exptoken; <---- errors out here

The error says "TypeError: can't concat str to bytes".

There is no guarantee that values in an access token will be ASCII.
The correct specification of the token is in the TDS protocol:
https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-tds/f40cca29-29b8-43ec-b9ff-2f8682486c29

The client then generates and sends a tokenless Federated Authentication Token message that contains binary authentication data that is generated by the federated authentication library.

https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-tds/827d9632-2957-4d54-b9ea-384530ae79d0

At least for a JWT access token -- which is what Azure AD vends - the UTF_16_LE encoding approach is both correct and very elegant.  JWT is comprised of three BASE64 encoded sections joined by dots.  Since BASE64 is a strict subset of ASCII and since the dot character is also ASCII, the entire payload will be ASCII.

Hi,
I am getting the below error. Does anyone have any idea?
here is the code I am using
context = adal.AuthenticationContext(authority_url, api_version=None)
token = context.acquire_token_with_client_credentials(
"https://database.windows.net/",
'xxxxxxxxxxxxxxxxxxx',
'xxxxxxxxxxxxxxxxxxx')
SQL_COPT_SS_ACCESS_TOKEN = 1256
connString = "Driver={ODBC Driver 17 for SQL Server};SERVER={xxxxxxxxx};DATABASE={xxxxxxx}"
#get bytes from token obtained
tokenb = bytes(token["accessToken"], "UTF-8")
exptoken = b'';
for i in tokenb:
exptoken += bytes({i});
exptoken += bytes(1);
tokenstruct = struct.pack("=i", len(exptoken)) + exptoken;
conn = pyodbc.connect(connString, attrs_before = { SQL_COPT_SS_ACCESS_TOKEN:tokenstruct});
"
TypeError                                 Traceback (most recent call last)
 in
18 tokenstruct = struct.pack("=i", len(exptoken)) + exptoken;
19
---> 20 conn = pyodbc.connect(connString, attrs_before = { SQL_COPT_SS_ACCESS_TOKEN:tokenstruct});
TypeError: connection string too long
"

That suggests you are trying to put the access token in the connection string (which it shouldn't be in), and are also using an older pyODBC version which had that limit on the connection string length.

Hi @michaelcapizzi , thanks a lot for sharing these snippets. I want to know about this:

In my case, the solution was explained here, but basically, my SQL admin had to add permissions for the app-registration to the specific database that I was trying to access.

I also need to convince my DBA about setting this up. They're insisting that there's no such thing - that there's no linking the registered applications to DBs. How does one do this? Some documentation links, screenshots etc would be very helpful. The MS docs I've seen go deep into regsitering applications and all, but don't show how to link the application to MSSQL.

You need to create a database user that corresponds to the identity of the token; see the docs for CREATE USER FROM EXTERNAL PROVIDE for more info.

@v-chojas thanks for all the huge help. Wanted to ask if FreeTDS supports this kind of method as well as far as you know.
Currently, I'm getting this result:
('08001', '[08001] [unixODBC][FreeTDS][SQL Server]Unable to connect to data source (0) (SQLDriverConnect)')
Where in ODBC Driver 17 for SQL Server this method succeeded.

In my case, the solution was explained here, but basically, my SQL admin had to add permissions for the app-registration to the specific database that I was trying to access.

How to add permission for the app-registration to the specific database?

Hi @michaelcapizzi , thanks a lot for sharing these snippets. I want to know about this:

In my case, the solution was explained here, but basically, my SQL admin had to add permissions for the app-registration to the specific database that I was trying to access.

I also need to convince my DBA about setting this up. They're insisting that there's no such thing - that there's no linking the registered applications to DBs. How does one do this? Some documentation links, screenshots etc would be very helpful. The MS docs I've seen go deep into regsitering applications and all, but don't show how to link the application to MSSQL.

I am also on the same page. How did you register or solved this issue?

Has anyone ever seen an issue in performance degradation when connecting with an access_token vs username and password? From analysis it seems that pooling of connections is not working correctly on an azure sql database with an access token vs username and password.

assert exptoken == access_token.encode("UTF-16-LE")
Just sayin'
Prepending each byte with a zero byte, in a case where the original text is ASCII text (base64 + dot . is), is equivalent to UTF-16 encoding, where each letter is encoded by 16 bits (2 bytes). The extra byte will be 0 for ASCII characters. The BE or LE means where that "big" byte will be (which is 0 for all ASCII characters) - at the end or not.
Effectively that counter-intuitive loop that I've been seeing everywhere, can be forgotten by just writing
exptoken = token["accessToken"].encode("UTF-16-LE")

in the first place, and not manually to UTF-8 and then add a zero byte to each byte.

Prepending each byte with a zero byte, in a case where the original text is ASCII text (base64 + dot . is), is equivalent to UTF-16 encoding, where each letter is encoded by 16 bits (2 bytes). The extra byte will be 0 for ASCII characters. The BE or LE means where that "big" byte will be (which is 0 for all ASCII characters) - at the end or not.

Yes, that will work provided you're input is ASCII. Note: don't forget to prepend the length of the string. See my str2mswin_bstr() example for the complete solution.
However, as the maintainer states in https://github.com/mkleehammer/pyodbc/issues/228#issuecomment-494847239, there is no guarantee that the input is ASCII. That's why I changed my solution to bytes2mswin_bstr(), listed in https://github.com/mkleehammer/pyodbc/issues/228#issuecomment-496439697.

Effectively that counter-intuitive loop that I've been seeing everywhere, can be forgotten by just writing

There's as much looping in my solution as there is in yours 😉

Yes, that will work provided you're input is ASCII

It's base64 str. It is always ASCII. The struct packing is not solved by encoding in UTF-16-LE, but otherwise if you lose the ugly Python loop that tries to prepare data that's compatible with MSODBC driver (that uses UTF-16-LE internally apparently), and do explicitly what needs to be done (encoding in UTF-16-LE), rather than manually playing with bytes, then it works.

The fact that you are currently seeing base64 strings as tokens is not a guarantee that that is what they will remain. The access token mechanism supports arbitrary binary data.
I am not a maintainer of pyODBC, but I do maintain the official Microsoft ODBC Driver for SQL Server.

Hi, no idea how it worked, but by using redhat's python image in the Dockerfile, the AzureAD login is working for me. I did not need to do any of this extra stuff; it connected to the DB in the same way non-AD connections happen; just with an extra "Authentication=ActiveDirectoryPassword" added in the connection string.
Dockerfile:
FROM registry.access.redhat.com/ubi8/python-38
USER root
RUN curl https://packages.microsoft.com/config/rhel/8/prod.repo -o /etc/yum.repos.d/mssql-release.repo
RUN yum remove unixODBC-utf16 unixODBC-utf16-devel
ENV ACCEPT_EULA=Y
RUN yum install -y unixODBC unixODBC-devel
RUN yum download -y msodbcsql17
RUN rpm -Uvh --nodeps msodbcsql17*rpm

# Python dependencies
RUN pip install --upgrade pip setuptools wheel
RUN pip install pyodbc SQLAlchemy pandas

EXPOSE 8000
COPY . /app/
RUN chmod +777 /app
WORKDIR /app

CMD python /app/launch.py

Now I'm not sure if at your end you'll be able to pull this red hat docker image or not - pls try and see.
In the program, credentials are loaded like so:
DRIVER: "{ODBC Driver 17 for SQL Server}"
SERVER: "tcp:<my-database>.database.windows.net,1433"
DATABASE: "officeride-reporting-qa"
UID: "<the org email account>",
PWD: "<the password>",
OTHER: "Encrypt=yes;TrustServerCertificate=no;Connection Timeout=30;Authentication=ActiveDirectoryPassword"

Note the "Authentication=ActiveDirectoryPassword" part at the end.
Code in program, assuming above creds are loaded into a "params" dict:
import sqlalchemy as db
import pyodbc
import urllib.parse
import pandas as pd

def initiateDB():
    dbString =  urllib.parse.quote_plus(r'DRIVER={};SERVER={};DATABASE={};UID={};PWD={};OTHER={}'\
        .format(params['DRIVER'], params['SERVER'], params['DATABASE'], params['UID'], params['PWD'], params['OTHER']))
    conn_str = r'mssql+pyodbc:///?odbc_connect={}'.format(dbString).strip()
    engine = db.create_engine(conn_str,echo=False, pool_recycle=3600)
    return engine

engine = initiateDB()
df = pd.read_sql('table1', engine)
print(df)

So, somehow in the redhat image it looks like pyodbc is taking care of AD auth under-the-hood, while on using regular python image or ubuntu image like FROM ubuntu:16.04 I was never able to get through. No idea why this difference is there.

I can confirm that that the following works for me with bytes2mswin_bstr as suggested in https://github.com/mkleehammer/pyodbc/issues/228#issuecomment-496439697
import pyodbc
from azure.identity import AzureCliCredential

credential = AzureCliCredential()

database_token = credential.get_token("https://database.windows.net/.default")

connection_string = "DRIVER={ODBC Driver 18 for SQL Server};SERVER=<your-db-server>.database.windows.net;DATABASE=<your-database>;Encrypt=Yes;"

tokenstruct = bytes2mswin_bstr(database_token.token.encode())
connection = pyodbc.connect(conn_str, attrs_before={1256: tokenstruct})

I can confirm that that the following works for me with bytes2mswin_bstr as suggested in #228 (comment)
import pyodbc
from azure.identity import AzureCliCredential

credential = AzureCliCredential()

database_token = credential.get_token("https://database.windows.net/.default")

connection_string = "DRIVER={ODBC Driver 18 for SQL Server};SERVER=<your-db-server>.database.windows.net;DATABASE=<your-database>;Encrypt=Yes;"

tokenstruct = bytes2mswin_bstr(database_token.token.encode())
connection = pyodbc.connect(conn_str, attrs_before={1256: tokenstruct})

I'm getting  [Microsoft][ODBC Driver 18 for SQL Server][SQL Server]Login failed for user '. I'm using my account which is probably admin. could this be the issue?

Is it actually empty or does it say  ? If empty you are probably not setting token correctly, if token-identified-principal then you haven't added the user to the server so it doesn't recognise the token.


Increase byinputdataset for TaskChain/StepChain content

the view is not returning the workflows that have InputDataset in the tasks considering TaskChain. Could this please be updated ?
Example https://cmsweb.cern.ch/couchdb/reqmgr_workload_cache/pdmvserv_SUS-chain_RunIIWinter15pLHE_flowRunIISpring15FSPreMix-00002__v1_T_150910_101516_5960
#6083 would need the same trick

sorry, nevermind, that seems to work actually

lack of sleep : it is relevant
pdmvserv_SUS-chain_RunIIWinter15pLHE_flowRunIISpring15FSPreMix-00002__v1_T_150910_101516_5960
uses internally
/SMS-T1bbbb_mGluino-600_mLSP-1to300_TuneCUETP8M1_13TeV-madgraphMLM-pythia8/RunIIWinter15pLHE-MCRUN2_71_V1-v1/LHE
https://cmsweb.cern.ch/couchdb/reqmgr_workload_cache/_design/ReqMgr/_view/byinputdataset?key="/SMS-T1bbbb_mGluino-600_mLSP-1to300_TuneCUETP8M1_13TeV-madgraphMLM-pythia8/RunIIWinter15pLHE-MCRUN2_71_V1-v1/LHE"&include_docs=true
return pdmvserv_SUS-RunIISpring15FSPremix-00002_00002_v0__150909_002951_3924 only

This is impacting operation

Damnit! We just had a testbed deployment :( I'll fix it for the current testbed

thanks


Text in datatable td won't wrap if no spacing

Hi,
I'm doing chat display system, someone entered the 500 char without spacing, then table width was out of the box. It only wrap the sentence with spacing. How to I solve it? Thanks

try to use this css on your input:
white-space: pre-wrap; word-wrap: break-word;

I change the code as below, but still not working
 yoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo

Why you are using table to display chat ?
however you could use this:
word-wrap: break-word; word-break: break-all; white-space: normal;

Is worked, Thank you very much


Time goes slower in new version

The song in new 3.7.2 version is slower than in 3.6, and its because the time is slower compared to windows time or old version time. One second in the editor is like 2seconds in real
adding video where i started the song in 3.7.2 version, and after 5seconds I launcher the same song in 3.6, after a while its ahead of the new version which started sooner
https://youtu.be/E8lt5k6fh-c

Duplicate of #101. Good news: it was just fixed! :D


Provide documentation/examples on how to use SDK in-process

Are there any examples or documentation on how to use this SDK for example in AspNetCore integration tests.
We would like to create automated E2E integration tests inside CI/CD, which would include Azure EventGrid topics with WebHook subscribers.
Therefore, I see this SDK as a perfect solution.
Scenario;

Spin up local http listener in test setup (eg. local port 8080)
Create dev-tunnel host on port 8080 and get the https url (Must be 443 and have a valid cert)
Register webhook subscriber on the event grid topic with the url from step 2.
Publish a CloudEvent to Event Grid topic
Verify CloudEvent is sent to the HttpListener from step 1.

What do you think?

Hi - The scenario does seem like a good use-case for the SDK.
At this time, we don't have any documented examples. However, you could first start with reviewing the test-cases which simulate similar scenarios - https://github.com/microsoft/dev-tunnels/blob/main/cs/test/TunnelsSDK.Test/TunnelHostAndClientTests.cs#L1484.
Beyond that, we'd be happy to answer any specific questions you have on use of the C# SDK.

Thank you @derekbekoe
I achieved it already in the meantime. :-) And I have running code available., that I would be happy to share, if you like.

Glad you were able to find a solution and there's no need to share the code.
I'll be closing this issue now. Thanks!


Doc: Define Layer 2 & 3 Network

These terms are used.  It may be useful for readers who are not network-SME's have a succinct definition. Even if it is definition by example.
The inter-webs should have a existing one we can reference.

Unfortunately, we no longer have time to devote to resolving this issue.  Closing, but happy for anyone to reopen - we didn't want to be thought of just opening up to-do lists for others.


how to get the file that is downloaded when pressing a button

So the situation:
First I need to login onto a page
Then go to the download page
Fill in some information
Press a button
The button trigger's some jQuery on the page that does a post json to other page that downloads the file.
I manage to login go to the download page and press the button but any idea how to fetch the file of the jQuery json call when pressing the button?

I never tryed so I have no idea for the moment. I guess that it goes in the download directory configured in chrome if automatic download is enabled.

Oeh, so there is a download directory, my next question then will be do you know the download dir?

So I'm almost there, when executing this script from the console in chrome it works:
Only chrome-php doesn't execute or wait on: xhr.onreadystatechange any tips?
$page->evaluate( '(() => { 	xhr = new XMLHttpRequest(); 	var url = "url"; 	xhr.open("POST", url, true); 	xhr.setRequestHeader("Content-type", "application/json"); 	xhr.onreadystatechange = function () {      		if (xhr.readyState == 4 && xhr.status == 200) {     		    		document.querySelector("#input").value = xhr.responseText;     		} 	} 	var data = JSON.stringify({"var1":"2"}); 	xhr.send(data);     })()'  );

By changing: xhr.open("POST", url, true); to xhr.open("POST", url, false); it works!


Events not called from the Main Thread

Hi
Admob event delegates are not called from the Main Thread, and I can't pause / unpause my game when using them.
Is there any particular way needed to be used, in order to make delegate methods (AdClosed etc) be run on Main Thread?

This issue is being closed due to its age. For bugs in the plugin open a new issue or reach out on our support group at https://groups.google.com/forum/#!forum/google-admob-ads-sdk.
Ram


Is the M1 version got released ?

Is the M1 version got released ?
I'm getting below error on my M1 .
creating build/lib.macosx-10.9-universal2-3.9
g++ -bundle -undefined dynamic_lookup -arch arm64 -arch x86_64 -g<EMAIL_ADDRESS><EMAIL_ADDRESS>build/temp.macosx-10.9-universal2-3.9/src/buffer.o build/temp.macosx-10.9-universal2-3.9/src/cnxninfo.o build/temp.macosx-10.9-universal2-3.9/src/connection.o build/temp.macosx-10.9-universal2-3.9/src/cursor.o build/temp.macosx-10.9-universal2-3.9/src/errors.o build/temp.macosx-10.9-universal2-3.9/src/getdata.o build/temp.macosx-10.9-universal2-3.9/src/params.o build/temp.macosx-10.9-universal2-3.9/src/pyodbccompat.o build/temp.macosx-10.9-universal2-3.9/src/pyodbcdbg.o build/temp.macosx-10.9-universal2-3.9/src/pyodbcmodule.o build/temp.macosx-10.9-universal2-3.9/src/row.o build/temp.macosx-10.9-universal2-3.9/src/textenc.o -L/usr/local/lib -lodbc -o build/lib.macosx-10.9-universal2-3.9/pyodbc.cpython-39-darwin.so
ld: library not found for -lodbc
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command '/usr/bin/g++' failed with exit code 1
ERROR: Failed building wheel for pyodbc
Originally posted by @sujiplr in https://github.com/mkleehammer/pyodbc/issues/870#issuecomment-934438368

Please ensure you have install the ARM version of unixODBC first.

These are the macosx ARM wheels I believe.  Please reopen if that is not correct.


Fixed utf8 characters not displaying in some environments

My solution is the same as calling utf8.char.
I did not use utf8.char because it was added in 5.3, and it would break on Lua version below it.

Specifically which environments is Busted being run in that can't display an utf8 character like this?

Any Lua lexer that dos not handle utf8 characters properly.
I used CraftOS-PC in headless mode.

And will this break on any other environments that currently work?

No, it won't break any other environments.
Because it is basically just escaping the character.
Proof:
> for _,v in pairs({tostring("◼"):byte(1,-1)}) do print(v) end
226
151
188
> for _,v in pairs({tostring("\226\151\188"):byte(1,-1)}) do print(v) end
226
151
188

It is also a general bad practice writing none ASCII characters unescaped in code.
This is the reason why python has "\N{}", it escapes the character and still keeps the readability.
And one reason for Lua 5.3+ having "utf8.char".


Migrate Endpoints to API V1.2

I audited the request/responses for each API endpoint for V1.2, and updated the JSON mocks to use the real request/responses.
I also update the models to match what is shown in V1.2. This adds things like Flat Fares, etc.
I also change some stringly-typed enums in the API into actual enums in the SDK, instead of strings.
As a part of this migration, RidesClient.fetchCheapestProduct was removed as we don't expose pricing structure for products with Upfront Fares anymore.

@bobz comments addressed :)


Will the pre-trained weights on handwritten data be made public?

Will the pre-trained weights on handwritten data be made public?

Hi,
Thank you for taking interest in our work and I apologize for the late reply.
At this time, we don't plan on releasing the weights.
If you have any questions as to how to reproduce the results you are more than welcome to ask and I will be happy to assist.
Thanks!


Use fullhash to avoid deprecation warning

What kind of change does this PR introduce?
Bugfix

Did you add tests for your changes?
No

Does this PR introduce a breaking change?
No

What needs to be documented once your changes are merged?
Nothing

broken because of casing in branch name


Work on directories option

It's possible to use a loop to upscale a folder full of images, but this is pretty slow for what it could be. Could you make it able to work on folders, probably by not restarting itself between frames?
Helpful for:
Upscaling a video's worth of frames
Upscaling a lot of images that don't relate to each other.
This would be drastically sped up in either case.
Thanks in advance regardless of decision.

The tool can process multiple files in one launch, without restarting the entire framework with DirectX etc. All you need to do is to pass parameters like:
FidelityFX_CLI.exe [Options] <SrcFile1> <DstFile1> <SrcFile2> <DstFile2> ...

See README.md for details of the command-line syntax.

Yes, but that can result in a massive command. Wouldn't it be easier to be able to do it without doing that?


Updated mobile documentation to point to the plugin options section.

The mobile page still had the activationWidth options. I updated the mobile documentation to point to the options section on the side-nav page.

Looks good, thanks!

@Dogfalo can you publish a new release with all these changes. Possibly also on Meteor? Thanks!


Plugin stop going deeper to translate the re-export from the other packages

Hi, thanks for this plugin. It help our project a lot in reduce file requests. But I notice the process of auto translate the import URL is just support the first level, when the imported package is exporting the other package's components from the same workspace it not going forward to process.
For example:
// module.ts import { a, b} from 'packageA'; import { c } from 'packageA';
// packageA/index.ts export { a } from './a'; export { b } from './b'; export { c } from 'packageB';
// packageB/index.ts export { c } from './c';
component a and b import statement is perfect translated to:
import { a } from 'packageA/a';
import { b } from 'packageA/b';
but component c is not being able to do the same, it translated to:
import { c } from 'packageB/index';
It would be nice if the plugin can handle this case, it will bring the flexibility in more use cases.

Sorry, my network causing the duplicated issue, please delete it.


HDDS-10147. Migrate TestFinalizeBlock to JUnit5.

What changes were proposed in this pull request?
Migrate TestFinalizeBlock test class to use JUnit5.
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-10147
How was this patch tested?
Existing test.

@adoroszlai, Can you please help to review.


typo: Double word "your"

:white_check_mark: Validation status: passed

File
Status
Preview URL
Details

windows-iotcore/manage-your-device/DevicePortal.md
:white_check_mark:Succeeded

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


Issues when submitting to App Store building against iOS 16

I've just built and uploaded a version of an app to the AppStore and received a warning indicating that PromiseKit is using non-public selectors from the upload process - I've submitted the build for TestFlight review (haven't submitted for a full review yet) but haven't gotten an approval/rejection at the time of writing
I assume it's actually just a naming collision rather than using non-public APIs but wanted to raise the issue ASAP to try and get a jump on a potential review rejection

XCode: 14.0.1
PromiseKit: 6.18.1
Installation: CocoaPods

Any updates to this issue?

The app got approved even with this warning (both to TestFlight and the AppStore)

Even though the upload is successful, submitting the release for review is rejected on the grounds of 2.3, how can this be resolved?

FYI this is not an issue with SPM.

The objective C portions of PromiseKit use some pretty low level tricks, it's possible Apple has now decided this is not acceptable.
I do not have a lot of time for PromiseKit nowadays since I’m trying to solve the fact I don’t have time with it via https://github.com/teaxyz, so if anyone affected by this could do the preliminary research I will then take over after that.
Specifically:

what's the beef
which part of the code?

lib signing issue reported by applestore
The app references non-public selectors in Payload/UnimedPlanoDeCuidado.app/Frameworks/PromiseKit.framework/PromiseKit: promise

Has anyone solved this problem？

I just took a cursory glance through our objc sources and we don’t seem to do anything that isn't public API. It's all C magic that is per the binary spec for objc.
Also I can't find a function called promise so. hmm.

@mxcl I'm not sure if this is worth mentioning or not but this warning only occurs for me when I'm archiving projects that were created in the latest versions of Xcode. I have a more mature project that I continuously update which utilizes PromiseKit a lot in the same manner as my newer projects and I'm yet to see the warning for it. If I archive my new projects in an older version of Xcode the warning does not occur on upload.
I have also had my newer project rejected from the store on a few occasions because of this warning but it seems to be up to the discretion of the tester as to whether the app should pass or not as they sometimes allow it even with the warning.

I'm using version 6.15.3 via SPM and I have not yet seen this App Store warning using Xcode 14.x
@Kaspik what version are you using?
I don't think this could be related to using the framework via SPM, so I've run a diff between versions 6.15.3 and 6.18.1 (reported in first comment). There is a change adding a file, Async.swift, that imports swift concurrency and uses async code with a function named async.
Extremelly wild guessing, could it be possible that using swift concurrency adds Apple extra checks for the framework about "restricted api words"?

I updated to version 6.18.1 and I still see the issue. We have a whitelabel app with various targets. For old existing targets when I upload the app I don't see the warning, for a new app which we are uploading to Testflight for the very first time I see the warning which leads me to think that this is some new validation which apple does for new apps. The two apps are almost identical otherwise - especially the parts dealing with PromiseKit.

SwiftPM doesn't have the objc portions so it is likely due to the objc portions that this warning shows up.

I updated to version 6.18.1 and I still see the issue. We have a whitelabel app with various targets. For old existing targets when I upload the app I don't see the warning, for a new app which we are uploading to Testflight for the very first time I see the warning which leads me to think that this is some new validation which apple does for new apps. The two apps are almost identical otherwise - especially the parts dealing with PromiseKit.

Can you please try v.6.15.3?

I've tried to validate an app with both 6.15.3 and 6.17.1, the warning is always there. I'm using Xcode 14.2.

I've just uploaded an app to App Store (TestFlight) and the  warning is gone...

Hello @sfiligoj
Did you use PromiseKit 6.22.1?

Hello @sfiligoj Did you use PromiseKit 6.22.1?

No, I'm using the 6.18.1 from CocoaPods. I was surprised about the successful upload  without warnings. Does this mean that Apple "released" a little bit the code check? I'm curious if there are other users that noticed this.

Hello @sfiligoj Did you use PromiseKit 6.22.1?

No, I'm using the 6.18.1 from CocoaPods. I was surprised about the successful upload without warnings. Does this mean that Apple "released" a little bit the code check? I'm curious if there are other users that noticed this.

Hello @sfiligoj
Thank you for your comment. @mpretty-cyro Can you please upload a build again?

Thank you for your comment. @mpretty-cyro Can you please upload a build again?

Yep, just submitted a build including 6.15.3 and the warning is gone 👍

Hello @mpretty-cyro
Great! Can you close the ticket please?