An efficient method of sorting pixels

Hello dear stranger,
I have created and implemented an efficient method for sorting images that does not limit span length.
On my old laptop this code takes about 12ms to execute:

I essentially recreated the method proposed in the beginning of the pixel sorting video that uses the Bitonic Merge Sort. However, I added some efficient code to detect whether to pixels lie in the same span/run/sequence/etc..
This is my first shader, so I am honestly really curious about your opinion of my code, as you are a far more experienced person than me. Anyhow, I am also aware from reading the other issues on this repository that you do not have much spare time, so I won't be expecting an answer to that request.
Since I do not have access to any other computers, I am also very curious about is the performance of my shader on your device, which is - I assume - a lot faster than mine. Again though, I do not expect a response.
Lastly I would just like to thank you for your interesting, educational and entertaining videos; I would have never (or not as soon) gotten into shader programming without them. Thanks! :)
Always remember that your videos are amazing
Jonathan
The following code is mostly just a copy of this repository.
The C# file:
using System.Collections.Generic;
using UnityEngine;
using static UnityEngine.Mathf;

public class Sorting : MonoBehaviour
{
    public enum SortBy
    {
        Red = 0, Green = 1, Blue = 2, Hue = 4, Saturation = 5, Lightness = 6
    }

    public enum ViewSource
    {
        Sorted, /*Synonymous to sortBy*/ SortValue, SequenceIds
    }

    public enum Direction
    {
        Up, Right, Down, Left
    }

    public ComputeShader computeShader;

    public SortBy sortBy = SortBy.Lightness;
    public ViewSource viewSource = ViewSource.Sorted;
    // In which direction the smallest value will lie in each sequence/run
    public Direction smallestValue = Direction.Left;

    [Range(0, 1)]
    public float lowThreshold = 0.25f;
    [Range(0, 1)]
    public float highThreshold = 0.75f;

    int screenWidth;
    int screenHeight;

    RenderTexture sortByTex;
    RenderTexture sequenceIds;
    RenderTexture sorted;

    // These are the kernels; They are all explained in further detail in the compute shader code
    int initialiseSortBy, sortHoriz, sortVert, fillSequenceIds, connectSequencesHoriz, connectSequencesVert, viewOtherPass;

    void Start()
    {
        Debug.Log("Shader is being initialised");

        if (computeShader == null)
        {
            Debug.LogError("The compute shader has not been set in the 'Sorting' Component");
            return;
        }

        initialiseSortBy = computeShader.FindKernel("InitialiseSortBy");
        sortHoriz = computeShader.FindKernel("SortHoriz");
        sortVert = computeShader.FindKernel("SortVert");
        fillSequenceIds = computeShader.FindKernel("FillSequenceIds");
        connectSequencesHoriz = computeShader.FindKernel("ConnectSequencesHoriz");
        connectSequencesVert = computeShader.FindKernel("ConnectSequencesVert");
        viewOtherPass = computeShader.FindKernel("ViewOther");

        RegenerateTextures();
    }

    // Creates a new render texture with the width and height of the screen
    RenderTexture createNewTexture(RenderTextureFormat format)
    {
        if (!SystemInfo.SupportsRenderTextureFormat(format)) Debug.LogError("The texture format " + format + " is not supported on this system");
        var output = new RenderTexture(screenWidth, screenHeight, 0, format, RenderTextureReadWrite.Linear);
        output.enableRandomWrite = true;
        output.Create();
        return output;
    }

    // This method is probably necessary to avoid memory leaks
    void ReleaseTexture(RenderTexture tex)
    {
        if (tex != null) tex.Release();
    }

    // Regenerates the textures; Does the same as in Acerola's code
    void RegenerateTextures(int width = -1, int height = -1)
    {
        Debug.Log("Regenerating textures");

        screenWidth = width == -1 ? Screen.width : width;
        screenHeight = height == -1 ? Screen.height : height;

        ReleaseTexture(sortByTex);
        ReleaseTexture(sequenceIds);
        ReleaseTexture(sorted);
        sortByTex = createNewTexture(RenderTextureFormat.R16);
        sequenceIds = createNewTexture(RenderTextureFormat.RInt);
        sorted = createNewTexture(RenderTextureFormat.ARGB64);
    }

    // Just a simple check
    void EnsureCorrectTextureSize(int width = -1, int height = -1)
    {
        if (width == -1) width = Screen.width;
        if (height == -1) height = Screen.height;

        if (screenWidth != width || screenHeight != height)
            RegenerateTextures(width, height);
    }

    private void Update()
    {
        if (computeShader == null) return;

        EnsureCorrectTextureSize();
    }

    void OnRenderImage(RenderTexture source, RenderTexture destination)
    {
        if (computeShader == null) return;

        // We call this method with the width and height of the source texture
        // This feature exists to enable the sorting of images outside of the whole-screen effect
        EnsureCorrectTextureSize(source.width, source.height);

        // Map a direction to these two booleans
        bool sortVertically;
        bool reverseSortingOrder;
        switch (smallestValue)
        {
            case Direction.Left:
                sortVertically = false;
                reverseSortingOrder = false;
                break;
            case Direction.Up:
                sortVertically = true;
                reverseSortingOrder = true;
                break;
            case Direction.Right:
                sortVertically = false;
                reverseSortingOrder = true;
                break;
            case Direction.Down:
                sortVertically = true;
                reverseSortingOrder = false;
                break;
            default:
                return;
        }

        // Sorted is the main work texture
        Graphics.Blit(source, sorted);

        // Setting variables
        computeShader.SetInt("sortingMode", (int)sortBy);
        computeShader.SetInt("width", sortVertically ? screenHeight : screenWidth); // This code is extremely sensible
        computeShader.SetBool("reverseSortingOrder", reverseSortingOrder);
        computeShader.SetBool("sortVertically", sortVertically);

        if (highThreshold < lowThreshold) highThreshold = lowThreshold;
        computeShader.SetFloat("lowThreshold", lowThreshold);
        computeShader.SetFloat("highThreshold", highThreshold);

        // Initialising the sortBy texture with values generated from sorted
        // Sorted currently just contains the source texture
        computeShader.SetTexture(initialiseSortBy, "sorted", sorted);
        computeShader.SetTexture(initialiseSortBy, "sortBy", sortByTex);
        computeShader.Dispatch(initialiseSortBy, CeilToInt(screenWidth / 8f), CeilToInt(screenHeight / 8f), 1);

        // This is where the fun begins

        // Give each pixel that should be sorted a unique sequence id
        computeShader.SetTexture(fillSequenceIds, "sortBy", sortByTex);
        computeShader.SetTexture(fillSequenceIds, "sequenceIds", sequenceIds);
        computeShader.Dispatch(fillSequenceIds, CeilToInt(screenWidth / 8f), CeilToInt(screenHeight / 8f), 1);

        // Select the correct kernel
        int connectSequences = sortVertically ? connectSequencesVert : connectSequencesHoriz;

        // "Connect adjacent pixels" which means to that adjacent pixels will have the same id
        computeShader.SetTexture(connectSequences, "sequenceIds", sequenceIds);
        computeShader.Dispatch(connectSequences, sortVertically ? screenWidth : 1, sortVertically ? 1 : screenHeight, 1);

        if (viewSource == ViewSource.Sorted)
        {
            // Sort

            // Here we select the correct pass
            int pass = sortVertically ? sortVert : sortHoriz;

            computeShader.SetTexture(pass, "sortBy", sortByTex);
            computeShader.SetTexture(pass, "sorted", sorted);
            computeShader.SetTexture(pass, "sequenceIds", sequenceIds);
            computeShader.Dispatch(pass,
                sortVertically ? screenWidth : 1,
                sortVertically ? 1 : screenHeight,
                1
                );
        }
        else
        {
            // View other source
            computeShader.SetInt("alternateSource", (int)viewSource - 1);
            computeShader.SetTexture(viewOtherPass, "sorted", sorted);
            computeShader.SetTexture(viewOtherPass, "sortBy", sortByTex);
            computeShader.SetTexture(viewOtherPass, "sequenceIds", sequenceIds);
            computeShader.Dispatch(viewOtherPass, CeilToInt(screenWidth / 8f), CeilToInt(screenHeight / 8f), 1);
        }

        Graphics.Blit(sorted, destination);
    }

    // This class is used for testing
    static class Profiler
    {
        private static Dictionary<string, long> segments = new Dictionary<string, long>();

        // Returns the time in milliseconds
        private static long time()
        {
            return (long)(Time.realtimeSinceStartup * 1000);
        }

        public static void StartSegment(string name)
        {
            segments[name] = time();
        }

        public static void EndSegment(string name)
        {
            long currentTime = time();
            long timeElapsed = currentTime - segments[name];

            Debug.Log(name + ": " + timeElapsed + "ms");
        }
    }
}

The HLSL file:

// The kernels are listed in order of execution

#pragma kernel InitialiseSortBy
#pragma kernel FillSequenceIds
#pragma kernel ConnectSequencesHoriz
#pragma kernel ConnectSequencesVert
#pragma kernel SortHoriz
#pragma kernel SortVert
#pragma kernel ViewOther

//                      The following two functions have been copied from Acerola's implementation

// Conversions from https://www.chilliant.com/rgb2hsv.html
float Epsilon = 1e-10;

float3 RGBtoHCV(in float3 RGB) {
    // Based on work by Sam Hocevar and Emil Persson (apparently)
    float4 P = (RGB.g < RGB.b) ? float4(RGB.bg, -1.0, 2.0 / 3.0) : float4(RGB.gb, 0.0, -1.0 / 3.0);
    float4 Q = (RGB.r < P.x) ? float4(P.xyw, RGB.r) : float4(RGB.r, P.yzx);
    float C = Q.x - min(Q.w, Q.y);
    float H = abs((Q.w - Q.y) / (6 * C + Epsilon) + Q.z);
    return float3(H, C, Q.x);
}

float3 RGBtoHSL(in float3 RGB) {
    float3 HCV = RGBtoHCV(RGB);
    float L = HCV.z - HCV.y * 0.5;
    float S = HCV.y / (1 - abs(L * 2 - 1) + Epsilon);
    return float3(HCV.x, S, L);
}

/////////////////////////////////////////////////// MY CODE //////////////////////////////////////////////////////////////////

// The input Textures
globallycoherent RWTexture2D<half> sortBy;
globallycoherent RWTexture2D<uint> sequenceIds; // This texture stores the id of a sequence that a pixel is in or 0 which means the pixel is not part of a sequence (very wide screen required for this very long comment)
globallycoherent RWTexture2D<float4> sorted;

// The threshold variables

half lowThreshold;
half highThreshold;

// The width of the in- and output textures
// When sorting vertically this is actually the height
int width;

bool reverseSortingOrder;

bool sortVertically;

// 0: red
// 1: green
// 2: blue
// 4: hue         Note the jump in this line
// 5: saturation
// 6: lightness
int sortingMode;

// 0: sortBy
// 1: mask
// 2: sequenceIds
int alternateSource;

// Stores the value to sort by and the index at which the colour data can be retrieved
struct PixelInfo {
    half sortBy;
    uint pixelIndex;
};

// I got tired of typing that long function name
#define SyncGroup AllMemoryBarrierWithGroupSync();
#define CalculateSmall(AXIS, INC) id.AXIS & ((1 << (INC - 1)) - 1)
#define CalculateLarge(AXIS, INC) id.AXIS >> (INC - 1) << INC

// These constants are used in two processes in this shader:
// - The bitonic merge sort
// - The sequence generation algorithm
// The Bitonic pattern will only sort 2048 pixels in this implementation, because the maximum threads per thread group is 1024
// In theory there is an easy fix: Each thread does double the work
#define BITONIC_ITERATIONS 12
#define BITONIC_SIZE 1024 // This is actually half of the actual width that this algorithm can process

groupshared PixelInfo pixelLine[BITONIC_SIZE * 2];
groupshared uint idLine[BITONIC_SIZE * 2]; // Sequence ids for one line

#define GroupsharedInitForConnecting(ID, AXIS) /*
*/    idLine[(ID).AXIS] = sequenceIds[(ID).xy];

#define GroupsharedInitForSorting(ID, AXIS) /*
*/    pixelLine[(ID).AXIS].sortBy = sortBy[(ID).xy]; /*
*/    pixelLine[(ID).AXIS].pixelIndex = (ID).AXIS;      /*
*/    idLine[(ID).AXIS] = sequenceIds[(ID).xy];

//                                              Kernel implementations

// Write the values by which we will sort into a texture
[numthreads(8, 8, 1)]
void InitialiseSortBy(uint3 id: SV_DispatchThreadID) {

    float3 input = sorted[id.xy].rgb;

    // This code just maps the 'sortingMode' integer into rgb/hsl
    if (sortingMode & 4) {
        input = RGBtoHSL(input);
    }

    switch (sortingMode & 3) {
        case 0:
            sortBy[id.xy] = input.r;
            break;
        case 1:
            sortBy[id.xy] = input.g;
            break;
        case 2:
            sortBy[id.xy] = input.b;
            break;
    }
}

// Stores either the pixel's x coordinate or 0 as its id in 'sequenceIds'
[numthreads(8, 8, 1)]
void FillSequenceIds(uint3 id: SV_DispatchThreadID) {
    uint result = 0;
    half value = sortBy[id.xy];

    if (value <= highThreshold && value >= lowThreshold)
        result = (sortVertically ? id.y : id.x) + 1;
    sequenceIds[id.xy] = result;
}

// This Kernel connects adjacent pixels
// Here is some pseudo-code:
// for (height = 2; height < BTIONIC_SIZE; height *= 2) {
//     Divide the current line of the texture into blocks of size 'height'
//     (Several threads will end up working on each of these blocks)
//
//     Select one of these blocks for the current using the 'id' field
//
//     If the left and right half of the current block are connected, i.e. the end of the right half and the start of the left half both are 1 in the mask texture {
//         Every pixel in the right half that is in the same sequence as the first pixel in the right half
//             is marked as part of the same sequence as the last pixel in the left half
//     }
// }
[numthreads(BITONIC_SIZE,1,1)]
void ConnectSequencesHoriz(uint3 id: SV_DispatchThreadID) {
    GroupsharedInitForConnecting(id, x);
    GroupsharedInitForConnecting(id.xy + int2(BITONIC_SIZE, 0), x);

    int index = id.x * 2;

    SyncGroup;

    if (idLine[index] * idLine[index + 1] != 0)
        idLine[index + 1] = idLine[index];

    SyncGroup;

    int small;
    int large;

    [unroll]
    for (int i = 2; i < BITONIC_ITERATIONS; i++) {
        small = CalculateSmall(x, i);
        large = (CalculateLarge(x, i)) + (1 << (i - 1));

        uint lastIdLeftHalf = idLine[large - 1];
        uint firstIdRightHalf = idLine[large];

        uint newId = idLine[large + small];

        if (small + large < width && lastIdLeftHalf * firstIdRightHalf != 0 && firstIdRightHalf == idLine[large + small]) {
            newId = lastIdLeftHalf;
        }

        SyncGroup;

        idLine[large + small] = newId;

        SyncGroup;
    }

    uint a = idLine[id.x];
    uint b = idLine[id.x + BITONIC_SIZE];

    SyncGroup;

    sequenceIds[id.xy] = a;
    sequenceIds[id.xy + int2(BITONIC_SIZE, 0)] = b;
}

// Same code as previous function, but connects sequences vertically
[numthreads(1, BITONIC_SIZE, 1)]
void ConnectSequencesVert(uint3 id: SV_DispatchThreadID) {
    GroupsharedInitForConnecting(id, y);
    GroupsharedInitForConnecting(id.xy + int2(0, BITONIC_SIZE), y);

    int index = id.y * 2;

    SyncGroup;

    if (idLine[index] * idLine[index + 1] != 0)
        idLine[index + 1] = idLine[index];

    SyncGroup;

    int small;
    int large;

    [unroll]
    for (int i = 2; i < BITONIC_ITERATIONS; i++) {
        small = CalculateSmall(x, i);
        large = (CalculateLarge(x, i)) + (1 << (i - 1));

        uint lastIdLeftHalf = idLine[large - 1];
        uint firstIdRightHalf = idLine[large];

        uint newId = idLine[large + small];

        if (small + large < width && lastIdLeftHalf * firstIdRightHalf != 0 && firstIdRightHalf == idLine[large + small]) {
            newId = lastIdLeftHalf;
        }

        SyncGroup;

        idLine[large + small] = newId;

        SyncGroup;
    }

    uint a = idLine[id.y];
    uint b = idLine[id.y + BITONIC_SIZE];

    SyncGroup;

    sequenceIds[id.xy] = a;
    sequenceIds[id.xy + int2(0, BITONIC_SIZE)] = b;
}

void swap(int a, int b) {
    PixelInfo temp = pixelLine[a];
    pixelLine[a] = pixelLine[b];
    pixelLine[b] = temp;
}

void compareAndSwap(int small, int large) {
    uint small_id = idLine[small];
    uint large_id = idLine[large];

    if (
        (large < width) && (small_id != 0) // If we are in bounds and the sequence and in a run/sequence
        &&  (small_id == large_id) // If we are in the same sequence
        && ((pixelLine[small].sortBy > pixelLine[large].sortBy) ^ reverseSortingOrder) // If we should swap
        )
    {
        swap(small, large);
    }
}

// Long live the bitonic merge sort!!
[numthreads(BITONIC_SIZE, 1, 1)]
void SortHoriz(uint3 id: SV_DispatchThreadID) {
    GroupsharedInitForSorting(id, x);
    GroupsharedInitForSorting((id.xy + int2(BITONIC_SIZE, 0)), x);

    int small;
    int large;

    [unroll]
    for (int i = 1; i < BITONIC_ITERATIONS; i++) {

        SyncGroup

        //flip
        small = CalculateSmall(x, i);
        large = CalculateLarge(x, i);
        int c = (1 << i) - 1 - small;
        small += large;
        large += c;

        compareAndSwap(small, large);

        [unroll]
        for (int j = i - 1; j > 0; j--) {

            SyncGroup

            //disperse
            small = CalculateSmall(x, j);
            large = CalculateLarge(x, j);
            small += large;
            large = small + (1 << (j - 1));

            compareAndSwap(small, large);
        }
    }

    SyncGroup

    float4 a = sorted[int2(pixelLine[id.x].pixelIndex, id.y)];
    float4 b = sorted[int2(pixelLine[id.x + BITONIC_SIZE].pixelIndex, id.y)];

    SyncGroup

    sorted[id.xy] = a;
    sorted[id.xy + int2(BITONIC_SIZE, 0)] = b;
}

// Just a copy of SortHoriz, but of course with vertical sorting
[numthreads(1, BITONIC_SIZE, 1)]
void SortVert(uint3 id: SV_DispatchThreadID) {
    GroupsharedInitForSorting(id, y);
    GroupsharedInitForSorting((id.xy + int2(0, BITONIC_SIZE)), y);

    int small;
    int large;

    [unroll]
    for (int i = 1; i < BITONIC_ITERATIONS; i++) {

        SyncGroup

        //flip
        small = CalculateSmall(y, i);
        large = CalculateLarge(y, i);
        int c = (1 << i) - 1 - small;
        small += large;
        large += c;

        compareAndSwap(small, large);

        [unroll]
        for (int j = i - 1; j > 0; j--) {

            SyncGroup

            //disperse
            small = CalculateSmall(y, j);
            large = CalculateLarge(y, j);
            small += large;
            large = small + (1 << (j - 1));

            compareAndSwap(small, large);
        }
    }

    SyncGroup

    float4 a = sorted[int2(id.x, pixelLine[id.y].pixelIndex)];
    float4 b = sorted[int2(id.x, pixelLine[id.y + BITONIC_SIZE].pixelIndex)];

    SyncGroup

    sorted[id.xy] = a;
    sorted[id.xy + int2(0, BITONIC_SIZE)] = b;
}

// Displays content from an alternate source like e.g. the mask texture
[numthreads(8,8,1)]
void ViewOther(uint3 id: SV_DispatchThreadID) {
    float value;

    switch (alternateSource) {
        case 0:
            value = sortBy[id.xy];
            break;
        case 1:
            uint s_id /* and Manny*/ = sequenceIds[id.xy];
            value = 0.0;
            if (s_id != 0) {
                value = s_id / 2.0 / width + 0.5;
            }
            break;
        default:
            value = length(id.xy) / width; // Just to show that an invalid value was sent to the gpu
            break;
    }

    sorted[id.xy] = float4(value, value, value, 1.0);
}

this is really cool wow.
took me a while to write something like this using WebGL but hecking good on you for actually making the span id assignment section efficient.

How did you implement this in WebGL??
At first I tried writing the shader in WebGL, but noticed that there is no way to assign values to arbitrary points in a texture (Only the point that a specific thread is made to operate on). How did you write this algorithm without that feature?
Also: thanks! :)

hi, I implemented it by instead of implementing swaps by calculating the pixel to compare to for each pixel, then determining if it should swap, if it should, it will set the output of the fragment to other pixel, if it doesn't need to swap, it sets the value to the original pixel.

it's a sorta jank solution but it sure works

yeah I know, I'm open to feedback on how I should comment my code.
idk how to do it well tbh


[BEAM-4059] Increasing timeout for Dataflow ValidatesRunner.

This increases the timeout to 4 hours, while we can figure out why it's running so slowly.

Run Dataflow ValidatesRunner


order_endpoints_sphere is failing when called at the end of split_segments_crossing_meridian

https://github.com/brendanjmeade/celeri/blob/c6e73065e2381fe4a9d44befc626376a843d41ae/celeri.py#L690-L690
ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
ValueError                                Traceback (most recent call last)
 in
6 segment = celeri.process_segment(segment, command)
7 sar = celeri.process_sar(sar, command)
----> 8 segment, station, block, mogi, sar = celeri.assign_block_labels(segment, station, block, mogi, sar)
9 assembly = celeri.create_assembly_dictionary()
10 assembly = celeri.merge_geodetic_data(assembly, station, sar)
~/Desktop/celeri/celeri.py in assign_block_labels(segment, station, block, mogi, sar)
362     # split them there so that the segment crawler can continue
363     # correctly.  JPL solution.
--> 364     segment = split_segments_crossing_meridian(segment)
365
366     np_segments = np.zeros((len(segment), 2, 2))
~/Desktop/celeri/celeri.py in split_segments_crossing_meridian(segment)
688         )
689         segment = pd.concat([segment_split, segment_whole])
--> 690         segment = order_endpoints_sphere(segment)
691     return segment
692
~/Desktop/celeri/celeri.py in order_endpoints_sphere(segment)
251     segment_copy = copy.deepcopy(segment)
252     for i in range(len(segment)):
--> 253         if segment.lon1[i] > segment.lon2[i]:
254             # print(i, "Reordering endpoints for segment ", segment.name[i].strip())
255             segment_copy.lon1.values[i] = segment.lon2.values[i]
~/opt/anaconda3/lib/python3.8/site-packages/pandas/core/generic.py in nonzero(self)
1440     @final
1441     def nonzero(self):
-> 1442         raise ValueError(
1443             f"The truth value of a {type(self).name} is ambiguous. "
1444             "Use a.empty, a.bool(), a.item(), a.any() or a.all()."
ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().

Closing because this runs correctly now and has for about a week.


[reflection-api] How to know if TypeLayout has scalar layout ?

Hi,
In my shader example : Shader
When I use the reflection API to give me the offsets for the MaterialData structure, which is passed as a pointer to the vertexMain function, I use this method:
slang::TypeLayoutReflection* typeLayout; // points to MaterialData
bufferSize = typeLayout->getSize();
// Validate category for each member, and get offset
...
if (category == SLANG_PARAMETER_CATEGORY_UNIFORM)
 member.offset = var->getOffset(SLANG_PARAMETER_CATEGORY_UNIFORM);

Currently, the issue is, while I go inside the typeLayout of the underlying type of the pointer type that is passed to vertexMain, as I ask the offset and size with category set as UNIFORM, I get offset which are completely different and aligned to 16 byte for example, than the actual offset of the SPIRV offset set for the individual member as you can see in the output.
Currently I am also stuck with another bug where going through the non-bindless path does not produce correct SPIRV, and duplicates descriptor ranges, which I already reported, so I am unable to verify if the offsets I obtain would be correct, had this buffer been bound via a ParameterGroup instead of a pointer.
Thanks in advance for pointing me to the right direction.

It seems to me that the layout you are querying are obtained using std140 rules (aggresively aligning things to 16 bytes), while the actual data should be laid out according to std430 rules. How did you obtain typeLayout?
I think there is a gap in the reflection API. Basically you want to call
ShaderReflection* r;

auto type = r->findTypeByName("MaterialData");
auto typeLayout = r->getTypeLayout(type, SLANG_LAYOUT_RULES_DEFAULT_STORAGE_BUFFER); // use storage buffer rules to obtain the layout.

Unfortunately we didn't expose SLANG_LAYOUT_RULES_DEFAULT_STORAGE_BUFFER yet.

In-fact, I am just iterating over my function parameters by entryPoint reflection like so-
auto parameterCount       = entryPoint->getParameterCount();
      for (uint32_t p = 0; p < parameterCount; ++p)
      {
        auto param = entryPoint->getParameterByIndex(p);
        emitParameter(param);
      }

In emitParameter I just check the layout of the pointer, then I obtain the ElementTypeLayout of the param's typeLayout.
My code is fairly generic and tries not to assume anything by type names.
I suppose the element type layout of a pointer which is a push constant variable should not be std140/430 layout, so it could be a bug?

Another point, the buffer is packed with scalar layout, not as std430, which I am completely okay with

This is a blocking issue for me, because I do not have a way to query the layout chosen by Slang. I also dont see how reflection interface can be used correctly without having a way to get the correct offsets. It feels like I can only get field names out of reflection and be content with it, and calculate everything else.

I need some more context understanding why there is a need to figure out if an existing layout is std140 or std430.
Most of the time the layout is well defined: StructuredBuffer element type is always std430 by default, and push constant is always std430 by default, and constant buffer is always std430 by default.
Slang also allows you to explicitly specify the layout to use for each individual buffer, by using ConstantBuffer<T, Std430DataLayout> or StructuredBuffer<T, ScalarDataLayout>.
You should also be able to query the offset of each field in a ConstantBuffer using the reflection API.

The default layout can also be changed with -force-glsl-scalar-layout or -fvk-use-dx-layout compiler options.

Generally, it is not meaningful to ask the offset of T::member without an explicit layout rule. If you can provide the detailed code that you are using to obtain the TypeLayout for the uniform data in question, we may be able to diagnose more into what was wrong with the reflection logic.

Here is my attached source if you want to have a look, function where I start iterating over parameter is emitParameter
SlangModuleCompiler.cpp.txt
I will probably assume the struct layout (scalar or std430) from parameter type, and force slang to use specific layouts as a work-around. I will provide you with more details later in the day.

Will it be possible to expand LayoutRules to StructureBuffer and ConstantBuffer? The problem for me has been to get field offsets for a structure buffer, passed as an pointer in push constants, in my engine's bindless path. In non bindless path, this is a constant buffer with a binding generated by slang. In either case, the code needs to read all field info and fill the ShaderProgram instance with the shadar parameter names and offsets.

Yes, this should be easy to add.

I fixed the layout logic for pointer element types in PR #5797, you can refer to the test case added here: https://github.com/shader-slang/slang/blob/a3ec188b1bae46d0390b71f88e931946c4ced187/tools/slang-unit-test/unit-test-ptr-layout.cpp
Basically, the offsets you query from a TypeLayout("Ptr<StructType>")->getElementTypeLayout() should now be correct.

Thanks a lot for the quick fix !


Open VSX 404 error because of lowercased URL

Currently on b2ca2718d4953bc2b41592d2a6b76e3d28236e69 and found that open-vsx.wakatime.vscode-wakatime errors out:
trying https://open-vsx.org/api/wakatime/vscode-wakatime/24.2.0/file/wakatime.vscode-wakatime-24.2.0.vsix
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
^M  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--    0
curl: (22) The requested URL returned error: 404
error: cannot download vscode-wakatime-24.2.0.zip from any mirror

When compared with the correct link:
https://open-vsx.org/api/WakaTime/vscode-wakatime/24.2.0/file/WakaTime.vscode-wakatime-24.2.0.vsix

The difference is that the namespace WakaTime is not lowercased but retains its capitalization. Probably the same is also true for the extension ID, but in this case it's all lowercase.
As a quick workaround, vscode-marketplace.wakatime.vscode-wakatime works fine.

Same issue with open-vsx.editorconfig.editorconfig for which the correct URL is https://open-vsx.org/api/EditorConfig/EditorConfig/0.16.6/file/EditorConfig.EditorConfig-0.16.6.vsix. This also has both namespace and extension ID requiring "proper" capitalization.
I'm currently working around this using nix store add-file to add the manually downloaded (and renamed) files to the nix store.

@Jet132, I now use original names and versions in data/cache/*.json files. This works for me
nix build github:nix-community/nix-vscode-extensions/c4c
7f030776a8092de2f05e339f0cd9a68e40bd8#extensions.x86_64-linux.open-vsx.wakatime.vscode-wakatime

Thank you for the fix, works perfectly :+1: Also for the software in general
One sidenote: would have been nice if you had referenced this issue in the commit to make it easier to find

Fixed somewhere around ef51bab10c57c1bc0838cccab9210e89b7a6bcf9


Recipe for service worker and workbox

I think we need a recipe for service worker and workbox default precacheAndRoute code.
Some idea?

@frederikhors I have a working example with vite-plugin-pwa plugin, see comment on issue here https://github.com/antfu/vite-plugin-pwa/issues/124#issuecomment-904150466, you have a link there to my main branch of my fork of this repo.
/cc @benmccann (sorry to bother you) I talk with patak (vite) on discord, seems your are working on align svelte-kit with vite. It seems the service worker module is too old (doesn't include scope a way to register the service worker scope). If you are interested to include vite-plugin-pwa as a replacement for service worker module we can work together: I'm not an svelte developer and some svelte-kit concepts are hard to understand.
I also have included on vite-plugin-pwa a vite virtual module to work with svelte: just go to the repo and take a look at examples directory, you have inside 3 example for svelte.

I guess by scope you're referring to this issue: https://github.com/sveltejs/kit/issues/922
I will start a thread with you on Discord about vite-plugin-pwa: https://discord.com/channels/457912077277855764/879717438185431090/879717440894943322

@benmccann I Will open an issue/discussion tomorrow on svelte kit repo to clarify all service worker stuff: I will link to all related issues you mention and an explanation.
Maybe I link some issues/discussions from external repos loke vitesse template o vite-ssg.

https://github.com/antfu/vite-plugin-pwa now has docs for Svelte and SvelteKit: https://vite-plugin-pwa.netlify.app/frameworks/sveltekit.html
I think there's still more we can do to make that integration easier and better support it. I don't know if a recipe is the best solution as much as just making the plugin really easy to install. Maybe we should close this issue?


Support extending the  section with custom links

Using a partial, you can help users (like myself) extending some parts of the header. In your  section, you can include an optional partial by the user, called header.extended.html or something like this.
This way, we can add more things like custom scripts, fonts, etc

@ITAYC0HEN I added the ability to extend the head and footer. You can place you own layouts/partials/extended-footer.html and layouts/partials/extended-head.html

Thank you!
Correcting for future visitors: it's layouts/partials/extend-footer.html and layouts/partials/extend-head.html


Future

The aim of this PR is completely refactoring all algorithms into a single powerful algorithm with multiple available moves,
inspired by Differential Evolution MCMC, Affine Invariant MCMC.
whether this will be merged in full, in part, or not is still to be decided.

@jbrea what do you think about this?

I agree on both points, a Particle struct Is a good idea, and It would be very nice if both my affine_mcmc and your adaptive_smc become implementations of AbstractMCMC, altough at the moment I find it difficult to follow the logic of that abstract interface.. 🤣


V11.305 dnd2.2.2 Toggling ActiveEffect gives a read only TypeError

Hi,
I'm trying to update a module to V11 and whilst calling toggleEffect() on a Token using a temporary effect attached to a Feature within a compendium it throws this error:
Uncaught (in promise) TypeError: Cannot assign to read only property '_id' of object '#'
at SchemaField._cleanType (commons.js:5300:20)
at SchemaField.clean (commons.js:4981:19)
at ActiveEffect5e.cleanData (commons.js:6949:26)
at TokenDocument5e.toggleActiveEffect (foundry.js:24892:11)
at Token5e.toggleEffect (foundry.js:55561:44)
at Object.addEffect (module.js:297:17)
at SocketlibSocket._executeLocal (socketlib.js:192:15)
at SocketlibSocket.executeAsGM (socketlib.js:90:16)
at handleAction (module.js:132:18)
I checked to ensure the Token and Effect are fetched correctly so I have no idea how to get around this as the same code worked for Foundry v10.
Whilst searching amongst the issues here it seems similar to #2294 at a cursory glance, which was fixed by calling toObject() in the backend of the dnd5e system. However, I don't wish to presume.

This is the ActiveEffect that is attempting to be used. Is it because it has no "_id" field, only a "id" field


Add code formatter button and key combination

Integrates prettier-plugin-motoko with Motoko Playground.
Code formatting is available through a button in the top-right of the editor as well as the key combinations Ctrl/Cmd/Option + Shift + F.
This will be a fantastic way to increase feedback about the formatter, since I'm guessing that a larger number of people will find and report bugs from MP compared to those using the Prettier plugin directly.

What's the bundle size diff?

This message now appears after using the formatter:

What's the bundle size diff?

The bundle size is now 6.7 MB (from 5.2 MB), which is apparently mostly from Prettier itself. However, this seems to be highly compressible, since the actual network transfer size is only 2.4 MB (from 2.2 MB).

Looks great!


Implicit conversions in equality comparisons

This is already sort-of implemented for >, <, >=, <=, and the arithmetic operations, but this adds the capability to evaluate things like:
"1.0" == 1 (evaluates to true)
1.1 == "1.0" (evaluates to false)
"7" == 7.2 (evaluates to true, "7" is an integer so we cast int(7.2) -> 7)

Thank you

Not sure if converting strings to ints/floats is necessarily a good idea for implicit conversions. Wouldn't it be better to have a to number function for strings?
https://www.w3schools.com/jsref/jsref_number.asp


Update windows.md

Removed the Homestead reference, as it's a general solution and works for Docker or any other environment, too.

Argh, wrong button, sorry! Still want that fix. ;)

Argh, wrong button, sorry! Still want that fix. ;)

Thanks!

Thanks!


Update prometheus-metrics-troubleshoot.md

Metric name in Metrics Throttling section was listed as 'Events Per Minuted Ingested % Utilization'. Fixed this after verifying metric name.

@bdegs - thanks !


add Roboto-Condensed and SourceSansPro fonts

Fixes

Fixes #4 by @dhruvkb
Description

This PR add fonts 'Roboto Condensed' and 'Source Sans Pro'
Type of PR
This PR is a feature.
Checklist:

[x] My pull request has a descriptive title (not a vague title like "Update index.md").
[x] My pull request targets the master branch of the repository.
[x] My commit messages follow best practices.
[x] My code follows the established code style of the repository.
[ ] I added tests for the changes I made (if applicable).
[ ] I added or updated documentation (if applicable).
[x] I tried running the project locally and verified that there are no visible errors.

Legal
By submitting this PR, I agree to abide by the terms of the Developer
Certificate of Origin.

Developer Certificate of Origin
Developer Certificate of Origin
Version 1.1
Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129
Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.
Developer's Certificate of Origin 1.1
By making a contribution to this project, I certify that:
(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or
(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or
(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.
(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.

@Tanuj22 WOFF and WOFF2 are the recommended font formats for web usage. OTF and TTF are better suited for local usage.

@dhruvkb I have made the requested changes. Please check them out.

@dhruvkb  Please checkout the changes

Since the font weight is different for different Source Sans Pro . It would be something like this right?
@mixin font-face($font-name, $font-file,$font-weight,$unicode) {    ... }

And sorry if I am taking a bit long getting done with by PRs. Actually I am traveling currently due to sudden close of college due to coronavirus .

@dhruvkb  Please checkout the changes

I don't want to delay this any more than I already have, it's a beautiful PR. Can you incorporate the changes from #6 to add a similar tables for the fonts you added here? It'll be slightly more complicated because of the multiple font weights (as compared to only one for CC Accidenz Commons) but that's the last change I'll request.

Okay, on it. Should there be different stories for different font weights>

I think you can add multiple tables in the same story.

@dhruvkb I am not quite sure if this is the correct approach. Please take a look.

Thanks! :smiley:


[Docs]: Switch column type in table

Is there an existing issue for this?

[X] I have searched the existing issues

Engineering Ticket Link
https://github.com/appsmithorg/appsmith/issues/6770
Release Date
Already in production
First Draft
No response
Loom video
No response
Discord/slack/intercom Link if needed
No response
PRD
No response
Test plan/cases
No response
Use cases or user requests
No response

Added to docs - https://docs.appsmith.com/reference/widgets/table/column-settings#switch


Fix: Remove duplicate classes in nested polymorphic models

See issue #281 for detailed explanation
this also adds a test which compares the created model files (individual model files) to the generated files, to check for differences.
the changes in KotlinGenModels doesn't introduce changes in any other api files apart from the nestedPolymorphicModel file
Sorry for creating this many files, i wanted to make sure my changes didn't cause any regressions in the model generation of other api files

Perhaps the test for models with the single file output could be deleted with this new test

Perhaps the test for models with the single file output could be deleted with this new test

Yes, I think this is a good idea. Let's do that as a precursor PR so we can both see the problem you have found and fix you have provided. Nice work

closing this in favor of #283 & #284 @cjbooms


Fix spanish translations

Objectives
This PR fixes some spelling errors in Spanish translations. 🤓

Coverage decreased (-0.4%) to 96.431% when pulling 130015e32e2289f1d92ea7e5ad0942c7028cef2f on decabeza:spanish_translations into 32787dea0516fd94506aa2c9e3673add264d9d2b on devise-security:master.

@olbrich @tmr08c any opposition to merging?


How do I download from Twitter exactly?

I inserted the Consumer API keys (tested successfully). However, when I insert a Twitter page, it instead tries to load api.twitter.com/[USERNAME] which is an invalid URL (as is http://api.twitter.com). Here's the log.
[17:49:54.381][Info] Updating checkboxes.
[17:49:55.967][Info] Loading results...
[17:49:55.969][Info] [api.twitter.com][Json] Loading page https://api.twitter.com/1.1/statuses/user_timeline.json?include_rts=true&exclude_replies=false&tweet_mode=extended&screen_name=twitter.com%2Fbrise_marine
[17:49:56.030][Info] [api.twitter.com][Json] Receiving page https://api.twitter.com/1.1/statuses/user_timeline.json?include_rts=true&exclude_replies=false&tweet_mode=extended&screen_name=twitter.com%2Fbrise_marine
[17:49:56.031][Error] [api.twitter.com][Json] Loading error: Error transferring https://api.twitter.com/1.1/statuses/user_timeline.json?include_rts=true&exclude_replies=false&tweet_mode=extended&screen_name=twitter.com203Fbrise_marine - server replied: Not Found (%4)
[17:49:56.031][Warning] [api.twitter.com] No valid source of the site returned result.
[17:50:14.161][Info] [api.twitter.com] Logging in...
[17:50:14.162][Info] [api.twitter.com] Login finished: success.
[17:50:24.598][Info] Loading results...
[17:50:24.599][Info] [api.twitter.com][Json] Loading page https://twitter.com/brise_marine
[17:50:24.772][Info] [api.twitter.com][Json] Receiving page https://twitter.com/brise_marine
[17:50:24.773][Info] [api.twitter.com][Json] Redirecting page https://twitter.com/brise_marine to https://api.twitter.com/brise_marine
[17:50:24.773][Info] [api.twitter.com][Json] Loading page https://api.twitter.com/brise_marine
[17:50:24.823][Info] [api.twitter.com][Json] Receiving page https://api.twitter.com/brise_marine
[17:50:24.824][Error] [api.twitter.com][Json] Loading error: Error transferring https://api.twitter.com/brise_marine - server replied: Not Found (203)
[17:50:24.824][Warning] [api.twitter.com] No valid source of the site returned result.

Hello

However, when I insert a Twitter page, it instead tries to load

Why are you inserting a Twitter URL?
Just enter the username in the search field and it'll load the images for that given user.

When I insert just the username, it doesn't load the images.  Is there a step I missed? I didn't see any tutorial on this, hence me asking with this thread.
User:
https://twitter.com/Brise_Marine
Oauth test verification:
https://puu.sh/E2UDL/29905c07bf.png
Display:
https://puu.sh/E2UDk/17ea014910.png
Log:
[18:23:41.861][Warning] [Qt][default] libpng warning: iCCP: known incorrect sRGB profile
[18:23:41.862][Warning] [Qt][default] libpng warning: iCCP: known incorrect sRGB profile
[18:23:59.897][Info] Loading results...
[18:23:59.898][Info] [api.twitter.com][Json] Loading page https://api.twitter.com/1.1/statuses/user_timeline.json?include_rts=true&exclude_replies=false&tweet_mode=extended&screen_name=Brise_Marine
[18:24:00.293][Info] [api.twitter.com][Json] Receiving page https://api.twitter.com/1.1/statuses/user_timeline.json?include_rts=true&exclude_replies=false&tweet_mode=extended&screen_name=Brise_Marine
[18:24:00.295][Info] [api.twitter.com][Json] Parsed page https://api.twitter.com/1.1/statuses/user_timeline.json?include_rts=true&exclude_replies=false&tweet_mode=extended&screen_name=Brise_Marine: 1 images (1), 0 tags (2), -1 total (-1), -1 pages (-1)
[18:24:55.529][Warning] [Qt][default] libpng warning: iCCP: known incorrect sRGB profile
[18:24:55.530][Warning] [Qt][default] libpng warning: iCCP: known incorrect sRGB profile
[18:24:58.719][Info] [api.twitter.com] Logging in...
[18:24:58.719][Info] [api.twitter.com] Login finished: success.

I'd also like to know how to download from Twitter. I'm sorry for my inexperience, but what steps do I have to fulfill first to search Twitter with Grabber? I'm a complete noob to this and Twitter, so help would be appreciated.


Convnext

Integration of ConvNeXt model and support for training/pretraining configs

implementation of PipelineMixin class for ConvNextForImageClassification
extending the run_image_classification_on_local_data.py example code to run and validate training the model with 2 variants from the paper:

ImageNet-1K fine-tuning from ImageNet-22K pre-trained weights loaded from the original FB code downloaded from this table
ImageNet-1K (pre/full) 300 epoch training code

tested with the tiny model config size

Example training config files attached below, run with:
python3 run_image_classification_on_local_data.py ./<config>.json

Note: the full (pre)training configs are dependant on this transformers bug fix in order to use stochastic depth as per the paper.
ConvNeXt_configs.zip

Please can add the model to the unit testing ala https://github.com/huggingface/optimum-graphcore/pull/81/files#diff-9e08e8c7769db7b58089fd7659d75ca96df40bb7b5d50299d3a30abd54da9ad6

Run make style to reformat with black.
Add timm as a dependency.

Need update for this check failure! @jimypbr @C-Bogdiukiewicz

you'll need to rebase

Sharing my list of planned changes:

[ ] remove timm from setup.cfg and add to setup.py testing requirements (I put it in the wrong place)
[ ] add a model card and ipu config at Graphcore/convnext-tiny-ipu for full 300 epoch training on a pod4 of tiny size in fp16 with cmd line to run in the readme (splitting out ipu-config and command line args from our mega configs attached above)
[ ] add convnext to the optimum-graphcore tests get it working/passing
[ ] retest and confirm that the config/command in the ipu model card works
[ ] revert FB weight loading code for the fine-tuning configs (we used this to test finetuning the tiny config from 22k pretrained which is not provided in the FB HF models)
[ ] copy transforms needed for training over to the run_image_classification.py example now that imagenet-1k is available in HF datasets
[ ] rebase


Address possible memory out-of-bounds accesses on connect requests

This PR addresses a couple of OOB accesses raised by @hac425xxx and contains a number of other fixes.

trans_force_read_s() The max size check does not need to be part of the read loop. This change moves the check out of the loop and uses a macro from parse.h to do it.
libxrdp_force_read() Error messages improved, plus fixed another possible unreported OOB if a length of 1-3 was passed in the TKTP header.
xrdp_iso_process_rdp_neg_req() Added check that the stream contains the rest of the RDP_NEG_REQ (MS-RDPCGR <IP_ADDRESS>.1) before reading it.
xrdp_iso_recv_msg() Added function header explaining purpose of function (took me a while to figure it out). Added check that enough data remained on stream for TPKT + first two bytes of X.224 CR-TPDU (fixes #1531) . Removed pointless check of length in TPKT header as this has already been checked when the stream was set up. Added check for reserved length value (X.224 13.2.1)
xrdp_iso_incoming() Function header added with doc references. Checked that X.224 length indicator field is consistent with the TPKT length and rejected packet if not (See MS-RDPCGR <IP_ADDRESS>.1). This allows us to use the stream length for the remainder of the function and fixes #1530. Checked stream contains enough data for a RDP_NEG_CORRELATION_INFO (MS-RDPCGR <IP_ADDRESS>.2) if encountered. Simplifies parsing of routingToken / cookie fields if encountered.

could you please request some cve for these bug, you can requset in github project
https://github.com/xebd/accel-ppp/security
the document for requtest
https://help.github.com/en/github/managing-security-vulnerabilities/publishing-a-security-advisory
Thanks A Lot!
@matt335672


Use np.nanmean for remove_dc=True

This fixes signal containing np.nan being incorrectly displayed in the raw browser (as described in https://github.com/cbrnr/mnelab/pull/313).

Thanks for fixing my Markdown @larsoner – I'm using Myst in my projects, which I find to be much simpler (maybe something we could consider in the future).

Thanks @cbrnr !


Small error in the Warnings when creating a bridge with ros2

Environment

OS Version:  Ubuntu 22.04
Source
ros2 humble
gazebo fortress

Description

Expected behavior: should print the ros2 type and the gazebo topic in the warning message
Actual behavior: swap the ros2 type and the gazebo topic in the warning message

Steps to reproduce

launch a ros_gz_bridge with a full set of configuration as parameters with an error in it (I wrote std_msgs/msg/float64 instead of std_msgs/msg/Float64 for example)

my yaml :
- ros_topic_name: "ros2gazebo/motor_back_left"
  ros_type_name: "std_msgs/msg/float64"
  gz_topic_name: "/model/world/joint/back_left_propeller_joint/cmd_pos"
  gz_type_name: "ignition.msgs.Double"
  direction:
    ROS_TO_GZ # Default "BIDIRECTIONAL" - Bridge both directions
    # "GZ_TO_ROS" - Bridge Ignition topic to ROS
    # "ROS_TO_GZ" - Bridge ROS topic to Ignition

my cmd :
ros2 run ros_gz_bridge parameter_bridge --ros-args -p config_file:=odrive_ros2gazebo/gazebo_bridge.yaml
Output
[INFO] [1682673937.724981799] [ros_gz_bridge]: Creating ROS->GZ Bridge: [ros2gazebo//motor_back_left (std_msgs/msg/float64) -> /model/world/joint/back_left_propeller_joint/cmd_pos (ignition.msgs.Double)] (Lazy 0)
[WARN] [1682673937.725289181] [ros_gz_bridge]: Failed to create a bridge for topic [ros2gazebo/motor_back_left] with ROS2 type [/model/world/joint/back_left_propeller_joint/cmd_pos] to topic [std_msgs/msg/float64] with Gazebo Transport type [ignition.msgs.Double]

Thanks for reporting this. Would you be able to submit a PR to fix it?

It's already fixed in the ros2 branch by PR #371. Just needs to be cherry-picked into humble and foxy branch.

Thanks @Bi0T1N! I opened #384 for humble.

Thanks guys !


[incubator-kie-drools#5701] org.kie.api.KieBase.getRule(String, Strin…

Issue:

https://github.com/apache/incubator-kie-drools/issues/5701

org.drools.model.codegen.execmodel.RuleAttributesTest#testMetadataBasics is fixed.

@mariofusco @yurloc @pibizza Please review, thanks!

Rebased to solve a conflict.

Progress: There were 549 failed tests.
Fixes #5701.


{ "error": "Function returned invalid status code: 0. Raw body: empty.last" } (facebook auth)

For bug reports, please fill in the next sections:
Current behavior
{ "error": "Function returned invalid status code: 0. Raw body: empty.last" }
Possible Unhandled Promise Rejection (id: 0):
Error: GraphQL error: A function returned an unhandled error. Please check the logs for executionId 'eu-west-1:simple:xxx'
Error: GraphQL error: A function returned an unhandled error. Please check the logs for executionId 'eu-west-1:simple:xxx'
    at new ApolloError (blob:http://localhost:8081/8c76b95f-35c2-4714-9300-393a22b880fc:59089:36)
    at Object.next (blob:http://localhost:8081/8c76b95f-35c2-4714-9300-393a22b880fc:59957:41)
    at SubscriptionObserver.next (blob:http://localhost:8081/8c76b95f-35c2-4714-9300-393a22b880fc:61624:18)
    at blob:http://localhost:8081/8c76b95f-35c2-4714-9300-393a22b880fc:64683:34
    at tryCallOne (blob:http://localhost:8081/8c76b95f-35c2-4714-9300-393a22b880fc:13415:14)
    at blob:http://localhost:8081/8c76b95f-35c2-4714-9300-393a22b880fc:13516:17
    at blob:http://localhost:8081/8c76b95f-35c2-4714-9300-393a22b880fc:14836:21
    at _callTimer (blob:http://localhost:8081/8c76b95f-35c2-4714-9300-393a22b880fc:14725:9)
    at _callImmediatesPass (blob:http://localhost:8081/8c76b95f-35c2-4714-9300-393a22b880fc:14761:9)
    at Object.callImmediates (blob:http://localhost:8081/8c76b95f-35c2-4714-9300-393a22b880fc:14980:14)

Reproduction
graphcool.yml
    type: resolver
    schema: src/facebook/facebookAuthentication.graphql
    handler:
      code: src/facebook/facebookAuthentication.ts

facebookAuthentication.graphql
type AuthenticateFacebookUserPayload {
  id: ID!
  token: String!
}

extend type Mutation {
  authenticateFacebookUser(facebookToken: String!): AuthenticateFacebookUserPayload!
}

facebookAuthentication.ts
import {fromEvent, FunctionEvent} from 'graphcool-lib'
import {GraphQLClient} from 'graphql-request'

interface User {
    id: string
}

interface FacebookUser {
    id: string
    email: string | null
}

interface EventData {
    facebookToken: string
}

export default async (event: FunctionEvent<EventData>) => {
    console.log(' 1 event ', event)

    try {
        const graphcool = fromEvent(event)
        const api = graphcool.api('simple/v1')

        const {facebookToken} = event.data

        // call Facebook API to obtain user data
        const facebookUser = await getFacebookUser(facebookToken)

        // get graphcool user by facebook id
        const user: User = await getGraphcoolUser(api, facebookUser.id)
            .then(r => r.User)

        // check if graphcool user exists, and create new one if not
        let userId: string | null = null

        if (!user) {
            // error happened on create user as I understand
            userId = await createGraphcoolUser(api, facebookUser)
            return {data: {userId: userId }}
        } else {
            userId = user.id
        }

        // generate node token for User node
        const token = await graphcool.generateNodeToken(userId!, 'User')

        return {data: {id: userId, token}}
    } catch (e) {
        console.log(e)
        return {error: 'An unexpected error occured during authentication.'}
    }
}

async function getFacebookUser(facebookToken: string): Promise<FacebookUser> {
    console.log(' getFacebookUser ', facebookToken)
    const endpoint = `https://graph.facebook.com/v2.9/me?fields=id%2Cemail&access_token=${facebookToken}`
    const data = await fetch(endpoint)
        .then(response => response.json())

    if (data.error) {
        throw new Error(JSON.stringify(data.error))
    }

    return data
}

async function getGraphcoolUser(api: GraphQLClient, facebookUserId: string): Promise<{ User }> {
    console.log(' getGraphcoolUser ', api, facebookUserId)
    const query = `
    query getUser($facebookUserId: String!) {
      User(facebookUserId: $facebookUserId) {
        id
      }
    }
  `

    const variables = {
        facebookUserId,
    }

    return api.request<{ User }>(query, variables)
}

async function createGraphcoolUser(api: GraphQLClient, facebookUser: FacebookUser): Promise<string> {
    const mutation = `
    mutation createUser($facebookUserId: String!, $email: String) {
      createUser(
        facebookUserId: $facebookUserId
        email: $email
      ) {
        id
      }
    }
  `
  const variables = {
    facebookUserId: facebookUser.id,
    email: facebookUser.email
  }
  return api.request<{ createUser: User }>(mutation, variables)
    .then(r => r.createUser.id)
}

facebookCallback
 _facebookCallback = async facebookToken => {
      if (!!facebookToken) {
        console.log('facebookToken ', facebookToken)
// already have some token here, facebook API works fine
        const graphcoolResponse = await this.props.authFbUser({variables: { facebookToken }})
//
        console.log('graphcoolResponse ', graphcoolResponse)
        const graphcoolToken = graphcoolResponse.data.authenticateUser.token
        AsyncStorage.setItem('SHORTLY_TOKEN', graphcoolToken)
        window.location.reload()
      } else {
        console.warn(`User did not authorize the Facebook application.`)
      }
    }

const authFbUser = graphql(AUTHENTICATE_FACEBOOK_USER, { name: 'authFbUser' });
const HomeScreen = compose(
    authFbUser,
    ...
);
export default HomeScreen(Home);

action
export const AUTHENTICATE_FACEBOOK_USER = gql`
    mutation AuthenticateUserMutation($facebookToken: String!) {
        authenticateFacebookUser(facebookToken: $facebookToken) {
            id
            token
        }
    }
`

schema
type User @model {
    id: ID! @isUnique
    fullName: String
    username: String @isUnique
    avatar: File @relation(name: "UserAvatar")
    dateOfBirth: DateTime
    email: String! @isUnique
    password: String
    age: Int
    createdAt: DateTime! # read-only (managed by Graphcool)
    updatedAt: DateTime! # read-only (managed by Graphcool)
    facebookUserId: String @isUnique
    posts: [Post!]! @relation(name: "UserPosts")
}

Expected behavior?
return value will be
{
      id
      token
}

See The Workaround here: https://github.com/graphcool/graphcool-framework/issues/512

That's a shame! Do you have an isolation case where you can see that by adding only a console.log(), it causes the error?

Having also this issue with aws-sdk s3 upload.

Removing console.logs seems to help.

yes, it's a shame!, I comment all my console.log calls and finally works. It's weird, because in my local works fine. Now I have to find another way to track the behavior of the backend logs 😭

@brodriguezs one thing I have figured out as a workaround is using sentry and just forcing Raven.captureException(error, { extra: 'custom error message with ${variable}' } }). So just create a separate dev only sentry account for the sole purpose of debugging your graphcool functions more easily.

@grimunit can you explain this a bit more?

@rubelux basically use sentry as replacement for console.log. So don't put the Raven.captureException in a catch block, just put it where you would put a console.log and send the variables along that you're trying to inspect. And they print it out really cleanly for you and it has just been a faster way to view and debug the state in my functions.


Update parameters for indoor localization

Updated parameters for indoor localization

amcl/localize.yaml

tuned the parameters

robot_localization/rs_ekf.yaml

removed input of the linear acceleration for the rs camera as it causes drifting when the svea is at rest
set two_d_mode to true
added the linear y velocity to prevent drifting of the svea

scripts/actuation_to_twist.py

tuned some parameters

As we discussed for documentation's sake, add a plot or two showing that the new parameters improve performance.

Old parameters

New parameters
The first two figures on the top show the performance of indoor localization with the old parameters.
Major problems with the old parameters:

When the control input is low and doesn't move the SVEA physically, the localization stack treats these as valid inputs and update the SVEA position.
There are noise in the measurement of linear acceleration from the RS camera. When the SVEA is at rest, the RS camera can still measure some linear acceleration and affect the state estimation.


Python 3.9.0 compatibility with PyFluent 0.20

🔍 Before submitting the issue

[X] I have searched among the existing issues
[X] I am using a Python virtual environment

🐞 Description of the bug
I am getting a TypeError: unhashable type: 'list' when trying to import pyfluent in a clean Python 3.9.0 virtual environment (managed through conda):
Python 3.9.0 | packaged by conda-forge | (default, Nov 26 2020, 07:53:15) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import ansys.fluent.core as pyfluent
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\ProgramData\miniforge3\envs\pyfluent-0.20-py39\lib\site-packages\ansys\fluent\core\__init__.py", line 19, in <module>
    from ansys.fluent.core.launcher.launcher import (  # noqa: F401
  File "C:\ProgramData\miniforge3\envs\pyfluent-0.20-py39\lib\site-packages\ansys\fluent\core\launcher\launcher.py", line 14, in <module>
    from ansys.fluent.core.launcher.container_launcher import DockerLauncher
  File "C:\ProgramData\miniforge3\envs\pyfluent-0.20-py39\lib\site-packages\ansys\fluent\core\launcher\container_launcher.py", line 21, in <module>
    from ansys.fluent.core.launcher.error_handler import _process_invalid_args
  File "C:\ProgramData\miniforge3\envs\pyfluent-0.20-py39\lib\site-packages\ansys\fluent\core\launcher\error_handler.py", line 4, in <module>
    from ansys.fluent.core.launcher import launcher_utils
  File "C:\ProgramData\miniforge3\envs\pyfluent-0.20-py39\lib\site-packages\ansys\fluent\core\launcher\launcher_utils.py", line 12, in <module>
    from beartype import BeartypeConf, beartype
  File "C:\ProgramData\miniforge3\envs\pyfluent-0.20-py39\lib\site-packages\beartype\__init__.py", line 58, in <module>
    from beartype._decor.decormain import (
  File "C:\ProgramData\miniforge3\envs\pyfluent-0.20-py39\lib\site-packages\beartype\_decor\decormain.py", line 23, in <module>
    from beartype._conf.confcls import (
  File "C:\ProgramData\miniforge3\envs\pyfluent-0.20-py39\lib\site-packages\beartype\_conf\confcls.py", line 46, in <module>
    from beartype._conf.confoverrides import (
  File "C:\ProgramData\miniforge3\envs\pyfluent-0.20-py39\lib\site-packages\beartype\_conf\confoverrides.py", line 15, in <module>
    from beartype._data.hint.datahinttyping import (
  File "C:\ProgramData\miniforge3\envs\pyfluent-0.20-py39\lib\site-packages\beartype\_data\hint\datahinttyping.py", line 212, in <module>
    BeartypeReturn = Union[BeartypeableT, BeartypeConfedDecorator]
  File "C:\ProgramData\miniforge3\envs\pyfluent-0.20-py39\lib\typing.py", line 243, in inner
    return func(*args, **kwds)
  File "C:\ProgramData\miniforge3\envs\pyfluent-0.20-py39\lib\typing.py", line 316, in __getitem__
    return self._getitem(self, parameters)
  File "C:\ProgramData\miniforge3\envs\pyfluent-0.20-py39\lib\typing.py", line 421, in Union
    parameters = _remove_dups_flatten(parameters)
  File "C:\ProgramData\miniforge3\envs\pyfluent-0.20-py39\lib\typing.py", line 215, in _remove_dups_flatten
    all_params = set(params)
TypeError: unhashable type: 'list'

Upgrading to Python 3.10 seems to resolve the issue, and I do not get this TypeError. The docs suggest that Python 3.9 should still be supported though.
📝 Steps to reproduce

Create Python 3.9.0 virtual environment through conda
Install pyfluent 0.20
try to import pyfluent

💻 Which operating system are you using?
Windows
📀 Which ANSYS version are you using?
R24.1
🐍 Which Python version are you using?
3.9.0
📦 Installed packages
Python 3.9.0 environment:

about-time==4.2.1
alive-progress==3.1.5
ansys-api-fluent==0.3.22
ansys-api-platform-instancemanagement==1.1.0
ansys-fluent-core==0.20.0
ansys-platform-instancemanagement==1.1.2
ansys-units==0.3.2
beartype==0.17.2
certifi==2024.2.2
charset-normalizer==3.3.2
docker==6.1.3
grapheme==0.6.0
grpcio==1.64.0
grpcio-health-checking==1.48.2
idna==3.7
importlib_metadata==7.1.0
lxml==4.9.4
numpy==1.26.4
packaging==24.0
pandas==1.5.3
platformdirs==3.11.0
protobuf==3.20.3
psutil==5.9.8
python-dateutil==2.9.0.post0
pytz==2024.1
pywin32==306
PyYAML==6.0.1
requests==2.32.1
six==1.16.0
urllib3==2.2.1
websocket-client==1.8.0
zipp==3.18.2

#######################

Python 3.10 environment:

about-time==4.2.1
alive-progress==3.1.5
ansys-api-fluent==0.3.22
ansys-api-platform-instancemanagement==1.1.0
ansys-fluent-core==0.20.0
ansys-platform-instancemanagement==1.1.2
ansys-units==0.3.2
beartype==0.17.2
certifi==2024.2.2
charset-normalizer==3.3.2
docker==6.1.3
grapheme==0.6.0
grpcio==1.64.0
grpcio-health-checking==1.48.2
idna==3.7
importlib_metadata==7.1.0
lxml==4.9.4
numpy==1.26.4
packaging==24.0
pandas==1.5.3
platformdirs==3.11.0
protobuf==3.20.3
psutil==5.9.8
python-dateutil==2.9.0.post0
pytz==2024.1
pywin32==306
PyYAML==6.0.1
requests==2.32.1
six==1.16.0
urllib3==2.2.1
websocket-client==1.8.0
zipp==3.18.2

Hi @mhoeijm,

I am not able to reproduce this issue using python 3.9.12

Could you please try it once in a fresh environment and let us know.
Thank you

The devil seems to be in the details: Pyfluent import fails with Python 3.9.0, but succeeds with 3.9.12 on my side.

@mhoeijm, the issue seems to be here:

@hpohekar we need to update the documentation about the support for reliable python versions. Since 3.9-3.12 is mentioned as supported versions, we will have users using 3.9.0 and they will face issues.

@sravanansys Sure. Thank you.


Fix api key reading for create

Motivation
The expected behavior is that when calling command create with parameter --etherscan-api-key it's value is being used as a key for etherscan requests. If it's not present, the value from config is used. But right now it works different
In create, it's only possible to execute it explicitly setting --etherscan-api-key param, because it always uses value read from parameter, and if None is given, it will fail on preflight_check with "ETHERSCAN_API_KEY must be set" error.
Flow: CreateArgs.verify_preflight_check() -> (sets VerifyArgs.etherscan.key to value from cmd parameter) -> VerifyArgs.verification_provider() -> VerificationProviderType.client(self.etherscan.key) -> error
https://github.com/foundry-rs/foundry/blob/master/cli/src/cmd/forge/create.rs#L161L173
https://github.com/foundry-rs/foundry/blob/master/cli/src/cmd/forge/verify/mod.rs#L169
https://github.com/foundry-rs/foundry/blob/master/cli/src/cmd/forge/verify/provider.rs#L71
Solution
Use EtherscanOps.key() in VerifyArgs.verification_provider(), it will pick up the key from config if it has None value

src = "src"
out = "out"
libs = ["lib"]
[rpc_endpoints]
goerli = "${GOERLI_RPC}"

[etherscan]
goerli = { key = "${ETHERSCAN_TOKEN}" }`

You can try this configuration for the blank project.
forge create --rpc-url https://eth-goerli.public.blastapi.io --verify Counter --private-key $PK fails with "ETHERSCAN_API_KEY must be set".
I think the reason why it works for you may be because you are using $ETHERSCAN_API_KEY env variable in configuration file. If this variable is set to non empty value, than it will be picked up and processed as if it was passed via --etherscan-api-key


Add Basic Component - Paragraph

According to the conclusion of weekly meeting No. 2, we will leave HTML native p tag for the paragraph component.


embed raylib unmanaged c++ library in C# managed library

please embed the unmanaged c++ raylib library into a managed C# library.
I would recommend a .net framework and .net core version.
https://github.com/Fody/Costura.
this makes it easier on developers using your library and also allows people to static link their own libraries easier.
this would also make it easier to upload to nuget and overall make the users project and application cleaner.

this might also get rid of the need to compile with unsafe if the Bindings are compiled into it.

I don't know much about this. It says it is in maintenance mode and also mentions .NET Core 3 single file executable and assembly linking as alternatives.
I don't want to maintain seperate versions for framework and core.  That is why I moved the tests into one project with multiple targets. Also there was the announcement of .NET 5 which says there will be one .NET moving forward.
I do agree it might make it easier for people to use the project at first although I found myself wanting to customize raylib for my needs instead.

Update on this issue. I would like it to be easier to install and use the library. Current plan is to add a copy of the libraries of raylib for the release. I would consider the idea of embedding into a managed library if there is a up to date way of doing this.

@ChrisDill reopen this please
you can embed the native dll using the Fody libraries


Support gitlab in changelog entry

As discussed in https://github.com/dblock/danger-changelog/pull/41#discussion_r279213324 , it would be nice if danger-changelog also supported links to gitlab on changelog entries. (And possibly other sites too?)

Dup of https://github.com/dblock/danger-changelog/issues/34


Setup

I created the project setup

STATUS: APPROVED 🟢 ✔
Hi @AyoMoses1 👋,
Your project is complete!  There is nothing else to say other than... it's time to merge it :shipit:
Congratulations! 🎉

Highlights 🎯
✔ Linters are correct.
✔ Setup looks good. 📌
Cheers and Happy coding!👏👏👏
Feel free to leave any questions or comments in the PR thread if something is not 100% clear.
Please, remember to tag me in your question so I can receive the notification.

As described in the Code reviews limits policy  you have a limited number of reviews per project (check the exact number in your Dashboard). If you think that the code review was not fair, you can request a second opinion using this form.


Update Jupyter-Dev instructions

We have gotten a little bit of feedback from people starting to try jupyter-dev in the collaboration. I have gotten some notes on issues that came up and will add to the notes.

Adding a note, it appears that:

Thanks, I'll find the new location and update this.

Here's a version that I put together at the DESC sprint week:
(https://github.com/LSSTDESC/SSim_DC1/blob/master/Notebooks/lsst-kernel.sh


Add error log with thrown exception

@confluentinc It looks like @Prathibha-m just signed our Contributor License Agreement. :+1:
Always at your service,
clabot


Please add RealTime FaceRecognition Example.

Hi,
In the RealTime FaceRecognition Example, it does not use multi-threading. If you have time, please update the RealTime FaceRecognition Example used by HoloLens, thank you.

I am using the OpenCVForUnity.2.4.7 then the problem shows, is it the same as yours? or just the wrong version of my plugin?

Hi,
In the RealTime FaceRecognition Example, it does not use multi-threading. If you have time, please update the RealTime FaceRecognition Example used by HoloLens, thank you.

it occurs when i try to switch the platform in the build settings and shows no error before then.

From the error details, it appears to be a bug in a previous version of the OpenCVForUnity example code.
To solve this problem, use the latest version of the assets (2.4.8 or later).


How do I get the type of the function field in the return result?

in mysql case:

in sqlite3 case:

I saw the #395 issue. Is this the same problem?

Actually I'm running into this while trying to write a TestCase for the ColumnTypeScanType function.

You need to request the ColumnTypes from within a Range over rows. This is due to how SQLite works. See sqlite.org for more information. SQLite has to have _step() called before it can return what you looking for.
If anything is unclear take a peek at the v2.0.0 within result_test.go you can find what you are looking for.


Parse value of srcset attribute closer to specifications

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

[X] It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
[X] This message body should clearly illustrate what problems it solves.
[X] Ideally, include a test that fails without this PR but passes with it.

This PR attempts to fix #3299 which was a regression introduced by #3288 .
Problem
The problem lies with the the specifications of the srcset attribute:

If present, its value must consist of one or more image candidate strings, each separated from the next by a U+002C COMMA character (,). If an image candidate string contains no descriptors and no ASCII whitespace after the URL, the following image candidate string, if there is one, must begin with one or more ASCII whitespace.

Simply comma separating the value of the srcset attributes doesn't work in the case that there is a "," comma in one or more of the URLs of the srcset. Since popular image hosts like cloudinary use commas to enumerate transformations, this should be addressed, as prerendering fails when the crawler tries to crawl the resulting broken links.
Proposed Solution
Rather than just reverting back to the previous RegularExpression, I attempted to write a primitive parser to implement the specification, as Rich made the original PR to get away from hard to understand regexes.
There are problems with my parser though:
A. It fails in the case that there is a URL ending with a comma
B. It is significantly slower than the previous regex solution (https://jsbench.me/mxkybbu22g/1)
C. There might be other problems I'm overlooking
I also modified the fixtures to test for this behavior
Tests

[X] Run the tests with pnpm test and lint the project with pnpm lint and pnpm check

Changesets

[ ] If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running pnpx changeset and following the prompts. All changesets should be patch until SvelteKit 1.0

thank you!


Need better documentation how to install and use s2i

Currently, we suggest to compile s2i from sources in README.md https://github.com/openshift/source-to-image#installation
However, there is no need to do this if you just want to use the S2I, you can just grab the latest binary from the Releases page and unpack it into /usr/local/bin or somewhere into PATH.
We should mention that as the first installation method and prevent confused users installing Go, dealing with gopath and getting the GIT master version of s2i which might be broken.

In Fedora, there is also the s2i RPM.

How about create a spec file in this repo , andd using tito to make rpm pakcage ?

rpm is platform specific and we're not looking to distribute this in that way, i think pointing people to the release page is more appropriate.


Support skipping of use of bias in layer

Support of skipping of bias in a layer is needed from the finetuning purpose.
If the pretrained model does not use the bias, then nntrainer must not create a non-zero bias after training as it cannot be loaded with the pretrained model.

:octocat: cibot: Thank you for posting issue #1769. The person in charge will reply soon.

#1770 and #1780 supported this.


automatically install the pidgy kernel

i think at this point i am considering removing the kernel entirely. it makes more sense to use this as an ipython extension than anything else. include the extension is a lot more portable and allows for more integration. configuring kernels for different tools can be tedious.


Remove requires_grad check for replace and assign

fix #3879

Can you add tests confirming that this is okay to do, and things behave as expected?

Added some simple tests. Let me know if you have better ideas as I can't think of any now.
Also, I don't fully understand what .assign() does, how it's different from .replace(), and why they have to be separate.

No! I mean test that gradient behaves as expected.

replace/assign seems to work differently from torch.Tensor.copy_ (see my test). All the optimiser tests are failing when requires_grad is set, as they use assign. Should replace/assign be separate?

closing as stale


editColumn using HTML Builder

Is there a way to editColumn using DataTables as a Service?
For example using the Eloquent method I can:
return Datatables::of($list)
    //Show Type Icon
    ->editColumn('typeicon', '<i class="{{ $typeicon }} fa-2x glyphicon-2x">{{ $typeicontext }}</i>')

but there is no way I can see of doing this using the HTML Builder.

Yes, you can basically do everything from old version to the new one. Just add your editColumn on the ajax method. The develop branch is backward compatible.

On html method, you just need to specify the column as instructed on this tutorial. http://datatables.yajrabox.com/service

Thank you Yajra I should have noticed that thank you!


[Beta] Migrating Error Decoder

beta.reactjs.org currently missing /error-decoder (E.g. https://reactjs.org/docs/error-decoder.html/?invariant=421). https://beta.reactjs.org/docs/error-decoder.html/?invariant=421 will be redirected to https://legacy.reactjs.org/error-decoder.html?invariant=421 which becomes 404.

Why does /docs/something redirect to /something? I can't find this redirect.

Wait, https://beta.reactjs.org/docs/error-decoder.html/?invariant=421 redirects to https://legacy.reactjs.org/docs/error-decoder.html/?invariant=421 for me, which is correct.

Wait, https://beta.reactjs.org/docs/error-decoder.html/?invariant=421 redirects to https://legacy.reactjs.org/docs/error-decoder.html/?invariant=421 for me, which is correct.

It is working for me now, too. I don't know what happened on my side before, most likely I mistyped something in my browser's address bar.
But the issue is about migrating the existing Error Decoder to Beta Docs.
The current error decoder page has the following parts:

The markdown page: https://github.com/reactjs/reactjs.org/blob/d696cb1d2a1ea1d7eb92d5b098b51dde8fcc536c/content/docs/error-decoder.md?plain=1#L1-L5
The template of the page:
https://github.com/reactjs/reactjs.org/blob/d696cb1d2a1ea1d7eb92d5b098b51dde8fcc536c/src/pages/docs/error-decoder.html.js#L1-L10
A Gatsby plugin used to query error code json:
https://github.com/reactjs/reactjs.org/blob/d696cb1d2a1ea1d7eb92d5b098b51dde8fcc536c/plugins/gatsby-source-react-error-codes/gatsby-node.js#L13-L30

Yeah, porting the error decoder to the new site would be dope.

Yeah, porting the error decoder to the new site would be dope.

@rickhanlonii I have just created an initial prototype in #6214.


Flipping puzzle + 3 parody images

Can you replace the images with smaller images (<100KB hopefully)? Just make them smaller in an image editor or something.


Update Azure Core Shared Codes 2023-02-17_07:25:47

Update Azure Core Shared Codes 2023-02-17_07:25:47

Close since this is a test PR.


TemplateObjectFormula - text?

Good morning team,
In TemplateObjectFormula field I noticed that sometimes there is this string: {9920E712-82AE-4EB5-B658-BA323DB39959}{1D7AF5A4-56C4-466D-8FD3-1DEB0835715B}.
From what I've seen, it comes directly from the NPrinting repository.
What does this represent? Is it safe to replace with a blank (so '')?
Many thanks,
Riccardo

Hey there @JonnyPooleQlik ,
Do you have any idea about this point?
Many thanks,
Riccardo

Yes I do. That field contains the expressions for any formulas that exist in the NPrinting templates. Specifically, any formulas that show up in the left hand metadata tree when you open a NPrinting report template in the NPrinting Designer.  It is used in the 'Qlik Lineage' sheet in the 'Report Lineage' chart object. You need scroll to the right to see the field in this chart object, or, maximize the object to expand it and see all fields.  If you have any formulas, changing the expression of this field would hide the formula expression.

I think so too.


[IMPROVE] Transcript File Link on Close Chat

For task https://github.com/WideChat/Rocket.Chat/issues/1121

Removes email checks for sending transcript.
Receives string in HTML format and creates file for download.

Related PRs: https://github.com/WideChat/Rocket.Chat/pull/1130

@Shailesh351 can you review the last commit please....  (remove options button)

@AlexanderKanakis Steve is now thinking that downloading in html format might not be the best solution.  How hard is it to download as a txt file?  Can we do that instead?  Thanks...

@AlexanderKanakis this is looking good.... works great!  One comment though......  the button should not be available if the Admin has this setting set to false...  can you fix please?

As it is, the button still appears, but the visitor cannot download the transcript.

@AlexanderKanakis I have pushed code to incorporate above changes.

@AlexanderKanakis @ear-dev I just readded the options menu. And only removed the Finish Chat option from it. All the other options are configurable. So when all are disabled it won't show the options menu. It's also better to do it this way because we will get fewer conflicts while upstream catchup.
Please also verify at your end. Thanks!
https://github.com/WideChat/Rocket.Chat.Livechat/pull/130/commits/98500acee2033eafb5affeb6af2ff923f04c257c

@Shailesh351 this is good to go?  I think we should enable the isMobile switch in a separate PR....

@ear-dev Yupp, Good to merge this PR


Display several spatial columns

Hi postgis-preview is really great! Thanks!
Only I couldnt manage to display two different geometry columns from one query as in

SELECT st_astext(sq.point), sq.point as geom, sq.poly  as geom2
from
(
select ST_GeomFromText('POINT(-71.064544 42.28787)',4326) as point,
ST_GeomFromText('POLYGON((-71.1776585052917 42.3902909739571,-71.1776820268866 42.3903701743239,-71.1776063012595 42.3903825660754,-71.1775826583081 42.3903033653531,-71.1776585052917 42.3902909739571))') as poly
) sq;

Ok reading #17 I see that this is logically not possible?

I would say since the query ends up being converted into geoJSON/topJSON, it's not a good practice to have two geometries in the result set.  Postgis preview is looking for one specifically called geom, and that's all it is going to render on the map.
I would suggest you restructure your query so that your geoms are in the same column on different rows by UNIONing together two subqueries.
However, you are also mixing points and polygons in the same response, which may also cause problems.

Well, I still have the opinion that the tool should take any query no matter what the parameters are and visualize the result as good as possbile.
One approach would be use the GDAL/OGR  libs to pull the data via their ExecuteSQL function and then aggregate geometry fields into one GeometryCollection if there is more than one geometry field in the query result.
I am doing exactly the same using the python OGR libs and it works flawlessly.
Can't help much with node though unfortunately

I think it is reasonable to require that there is only one geometry per
row, as that is the way most spatial data are imported and exported (and in
order to be rendered in leaflet it must be geojson, which only has one
geometry per row)
It is a simpler proposition to combine your geometries together as part of
your query.
On Monday, August 8, 2016, rajanski<EMAIL_ADDRESS>wrote:

Well, I still have the opinion that the tool should take any query no
matter what the parameters are and visualize the result as good as
possbile.
One approach would be use the GDAL/OGR libs
https://github.com/naturalatlas/node-gdal to pull the data via their
ExecuteSQL function and then aggregate geometry fields into one
GeometryCollection if there is more than one geometry field in the query
result.
I am doing exactly the same using the python OGR libs and it works
flawlessly.
Can't help much with node though unfortunately
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/NYCPlanning/postgis-preview/issues/42#issuecomment-238191150,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABv7XOGOJuHO3SWENPc3BQraIlif21w8ks5qdvw2gaJpZM4IyNEj
.

I still think its possible easily. Just run this file in the browser (geojson with geometrycollection with multiple geometries in leaflet)
`

`

Just putting my two cents in. IMHO opinion, it's usually easy enough to just UNION your queries together.
e.g. @rajanski your query can be written to include both of your features as follows:
SELECT ST_GeomFromText('POLYGON((-71.1776585052917 42.3902909739571,-71.1776820268866 42.3903701743239,-71.1776063012595 42.3903825660754,-71.1775826583081 42.3903033653531,-71.1776585052917 42.3902909739571))', 4326) as geom

UNION

SELECT ST_GeomFromText('POINT(-71.064544 42.28787)', 4326) as geom

Honestly, I'd rather the preview work as is and not try to make too many assumptions with your data.
I don't think telling people to UNION their queries together is too big of an inconvenience. Some documentation of some sort and an example should be good.

@seabre I get your point . Anyway I was looking at prostgispreview from a point of teaching people SQL and postgis. In this context I do still think it would be better to make it behave like any other postgresql query client.

I think the original intent was to behave like CartoDB, where only one geometry column is expected.  IMHO it becomes more confusing to allow multiple geometry columns, as it may not be clear which one is being rendered.

They are all rendered as geomcollection

I think we should stick to a single geometry column with a specific name for the moment, if you still feel strongly about this, feel free to re-open.


query and pos cat issue

In  GeometricFeatureExtractor() function, the concatenation order is (query, pos), the code line is bellow: https://github.com/SehwanChoi0307/Mask2Map/blob/6281f3592503ecf74450d19a30b0e29889ce335f/projects/mmdet3d_plugin/mask2map/modules/transformer_2p.py#L590 . However, in MaskGuidedMapDecoder() function, the split order is (pos, query),  the code line is bellow: https://github.com/SehwanChoi0307/Mask2Map/blob/6281f3592503ecf74450d19a30b0e29889ce335f/projects/mmdet3d_plugin/mask2map/modules/transformer_2p.py#L752 . Why?

We believe that due to the feature blending caused by the gate function, the order of the positional and feature information at the beginning and end does not matter. Ultimately, as long as there is a consistent direction in the loss, the model can effectively utilize context and positional information.

In your opinion, the value, we can also call it the function, of query and query_pos are equivalent ?

In your opinion, the value, we can also call it the function, of query and query_pos are equivalent ?

In your opinion, the value, we can also call it the function, of query and query_pos are equivalent ?

In your opinion, the value and the function of query between query_pos are equivalent ?
The two tensors mask_aware_query_feat, mask_aware_query_pos are from PositionalQueryGenerator():  https://github.com/SehwanChoi0307/Mask2Map/blob/6281f3592503ecf74450d19a30b0e29889ce335f/projects/mmdet3d_plugin/mask2map/modules/transformer_2p.py#L524
mask_aware_query_feat_pia = mask_aware_query_feat_pia.unsqueeze(2) + pts_query_feat   mask_aware_query_pos = mask_aware_query_pos.unsqueeze(2) + pts_query_pos
pts_query_feat and pts_query_pos are split from same embedding weight, but mask_aware_query_feat_pia and mask_aware_query_pos are far away from different modules. The former is transformed from multi layer Mask2FormerTransformerDecoderLayer, the latter is transformed from self.decoder_positional_encoding, then multiplied by sigmoid mask_pred value. https://github.com/SehwanChoi0307/Mask2Map/blob/6281f3592503ecf74450d19a30b0e29889ce335f/projects/mmdet3d_plugin/mask2map/modules/transformer_2p.py#L498
Finally, in MaskGuidedMapDecoder() function, we use the concatenated mask_aware_query += self.out_proj(query) .  Yes, the original order of (query, query_pos) always keep. https://github.com/SehwanChoi0307/Mask2Map/blob/6281f3592503ecf74450d19a30b0e29889ce335f/projects/mmdet3d_plugin/mask2map/modules/transformer_2p.py#L749
      query = mask_aware_query + self.out_proj(attn_output + gate * (self.lin_self(mask_aware_query_norm) - attn_output))         query = query + self.mlp2(self.norm2(query))         query_pos, query_feat = torch.split(query, self.embed_dims, dim=-1)
Offcause if we change query = mask_aware_query + self.out_proj(attn_output + gate * (self.lin_self(mask_aware_query_norm) - attn_output))   to query = self.out_proj(attn_output + gate * (self.lin_self(mask_aware_query_norm) - attn_output)), then gate tensor may transform its orders.

The mask_aware_query_feat and mask_aware_query_pos from PositionalQueryGenerator() are distinct. As you understand, they are ultimately mixed through the gate function, so only the backward direction needs to remain consistent. While changing the gate function, as you suggested, could affect the sequence, we have adopted the original gate function of the Transformer, so the order should not have a significant impact.
I am not entirely certain I fully grasp the specific point or reasoning you are aiming to convey here; could you clarify your intent further?


Add doc examples for eq_dyn etc.

The comparison kernels have a somewhat bewildering array of options for a new developer
https://docs.rs/arrow/7.0.0/arrow/compute/kernels/comparison/index.html
We have been making the API easier to use with so called dyn kernels (such as eq_dyn, etc) but this may not be as discoverable as would be ideal.
Thus it would be great to add some doctests to the comparison module that demonstrated how to use those kernels with an example of creating two arrays, and then calling eq_dyn on them

Perhaps one could follow the example of
https://docs.rs/arrow/7.0.0/arrow/array/type.StringArray.html
use arrow::array::StringArray;
let array1 = StringArray::from(vec![Some("foo"), None, Some("bar")]);
let array2 = StringArray::from(vec![Some("foo"), None, Some("baz")]);
let result = eq_dyn(&array1, &array2).unwrap();
assert_eq!(BooleanArray::from(vec![Some(true), None, Some(false)]), result))

I can work on it! Please assign to me @alamb

Thanks @HaoYang670


Implement binary bitmap font format

Do not merge (yet) - the new logic breaks compatibility with the current format.
This uses SharpFNT and its binary format instead of the current textual format (Cyotek.Drawing.BitmapFont only supports XML and textual font files).
The conversion to this binary font format was done using SharpFNT itself:
var font = BitmapFont.FromFile(file.FullName);

// there's a bug with empty Charset that crashes on Save()
if (font.Info.Charset == string.Empty)
{
    font.Info.Charset = "ANSI";
}

font.Save(Path.GetFileNameWithoutExtension(file.Name) + ".bin", FormatHint.Binary);

Benchmark for font loading

Closes #1858

Change font files to use a binary format for better performance.

Yes, this PR is complete.
I planned on doing some benchmarks with osu and maybe find a way to measure the reduction in string allocations, but if you're fine without that, this is ready to merge.

Looks good!

Hi, I'm the developer of SharpFNT.  Sorry for commenting on a closed thread but I saw that you encountered a bug when writing files. I’ll have a fix for that soon and update the NuGet package. I apologize for the issue but if you happen to encounter any more please report it and I’ll get it fixed. Also, I saw that there were some concerns about the binary format. I simply followed the specification on the website for BMFont which is the original tool for creating fnt files.  That conversion tool you mentioned is likely outdated. The magic numbers just help identify what kind of file it is. Thanks for using my library!

@ToddBertaOldham thanks for the clarification!

I just posted an update that should fix some issues and inconsistencies with null strings. Your workaround works about the same so there's no rush to update but I figured I'd mention it.


Issue with canoe_inst = CANoe()

I am having some issues running the code:

hey thanks for pointing this issue.
now this issue is fixed. now you have the option to provide py_canoe log directory. but be careful if you are not giving any path then default path will be 'D:.py_canoe'
example:
canoe_inst = CANoe(py_canoe_log_dir=r'D:.py_canoe')


feat(files): Added orphaned file cleanup function

PR related to this trello task --> https://trello.com/c/Z1Q4OY71

:tada: This PR is included in version 1.2.0 :tada:
Your semantic-release bot :package::rocket:


Deprecated Atom APIs will be removed June 1st

Atom will no longer load this package after June 1st without changes. There is one deprecation on the latest version (0.3.0) of this package:

Use Workspace::onDidAddTextEditor instead

Visit https://gist.github.com/benogle/6d09e295c84b717ef9b4 and search for your package name to see up-to-date deprecations.
If this package has been replaced by another package or functionality in core, please reply with this information.
See https://github.com/atom/atom/issues/6867 for more info. Thanks!

@benogle In my Atom(0.201), I can't see such kind of the deprecation warning and didn't understand what that mean.
But Atom show "styles/angularjs.less
Style elements within text editors using the atom-text-editor::shadow selector or the .atom-text-editor.less file extension. If you want to target overlay elements, target them directly or as descendants of atom-overlay elements." deprecation warning.
I can't find any document about how to fix it. I just found a issue about it.
Can you provide infomation or documents about that?

Super sorry about this. It was a false positive.
You can fix the styles via this guide: https://atom.io/docs/latest/upgrading-to-1-0-apis-upgrading-your-ui-theme-or-package-selectors

@benogle Thanks you for providing the guide.
So, onDidAddTextEditor is same warning with atom-text-editor::shadow?

No it's not the same. You can disregard the message in this thread.
On Wednesday, May 27, 2015, JeongHoon Byun (aka Outsider) <
<EMAIL_ADDRESS>wrote:

@benogle https://github.com/benogle Thanks you for providing the guide.
So, onDidAddTextEditor is same warning with atom-text-editor::shadow?
—
Reply to this email directly or view it on GitHub
https://github.com/angular-ui/AngularJS-Atom/issues/41#issuecomment-106151491
.


Wagtail SQL call on none wagtail pages

Hi,
I have included wagtail to my project as a cms system. But I have also some old static pages which also produce allways this SQL call:
SELECT"wagtailcore_site"."id", "wagtailcore_site"."hostname", "wagtailcore_site"."port", "wagtailcore_site"."site_name", "wagtailcore_site"."root_page_id", "wagtailcore_site"."is_default_site", CASEWHEN ("wagtailcore_site"."hostname" = '''<IP_ADDRESS>''' AND "wagtailcore_site"."port" = '8000') THEN '0' WHEN ("wagtailcore_site"."hostname" = '''<IP_ADDRESS>''' AND "wagtailcore_site"."is_default_site" = 'True') THEN '1' WHEN "wagtailcore_site"."is_default_site" = 'True' THEN '2' ELSE '3' END AS "match", "wagtailcore_page"."id", "wagtailcore_page"."path", "wagtailcore_page"."depth", "wagtailcore_page"."numchild", "wagtailcore_page"."title", "wagtailcore_page"."slug", "wagtailcore_page"."content_type_id", "wagtailcore_page"."live", "wagtailcore_page"."has_unpublished_changes", "wagtailcore_page"."url_path", "wagtailcore_page"."owner_id", "wagtailcore_page"."seo_title", "wagtailcore_page"."show_in_menus", "wagtailcore_page"."search_description", "wagtailcore_page"."go_live_at", "wagtailcore_page"."expire_at", "wagtailcore_page"."expired", "wagtailcore_page"."locked", "wagtailcore_page"."first_published_at", "wagtailcore_page"."last_published_at", "wagtailcore_page"."latest_revision_created_at", "wagtailcore_page"."live_revision_id"FROM "wagtailcore_site" INNER JOIN "wagtailcore_page" ON ("wagtailcore_site"."root_page_id" = "wagtailcore_page"."id") WHERE ("wagtailcore_site"."hostname" = '''<IP_ADDRESS>''' OR "wagtailcore_site"."is_default_site" = 'True') ORDER BY "match" ASC | 98,487335358% | 144,35 | SelExpl   |
This call takes on my desktop computer (in debug mode with sqlite) 150ms. Is there something wrong?
And why is this SQL query also called on a none wagtail page?
Issue Summary
Wagtail is calling SQL queries which I don't need

Thanks for the report @sowinski! This query is called from the wagtail.wagtailcore.middleware.SiteMiddleware class to populate the request.site variable. I agree that running this query on every page (including ones that have no relation to Wagtail) is undesirable, and ideally I'd like to eliminate this middleware completely.

Well, the site object may be needed on non-Wagtail parts of a site, depending on how it is built. For example, you may access the site object to obtain a setting object from wagtail.contrib.settings.
So there's no way to know if request.site will be needed unless you use it. Sounds familiar? That's what we call a lazy object in Django: complex computing is delayed until needed the first time in a request.
Which leads me to this conclusion: we should make request.site a lazy object for this kind of optimization. Unfortunately, this will be useful mostly on small projects, as most medium Wagtail sites I've been working on use request.site globally.

@BertrandBordage It would be good to do both, I think. Making request.site a lazy object would eliminate the redundant query in the case that the middleware can't be removed (e.g. because existing code on the site depends on it), but having the middleware there at all feels unnecessarily intrusive, and is overhead that we don't need.
(There also seems to be a common perception that our SiteMiddleware creates an incompatibility with django.contrib.sites - I'm yet to pin down whether that's really true, but if we can avoid the issue completely, that has to be a good thing :-) )
I propose that we handle this as follows:

Update the Site.find_for_request(request) method to cache the resolved site on the request object, using a suitably non-intrusive name such as request._wagtail_site
Update all Wagtail code that uses request.site to use Site.find_for_request(request) instead. (I suppose we'll need to provide a template tag too...)
Rewrite SiteMiddleware so that it sets request.site to a lazy object* that calls Site.find_for_request (*or whatever Python construct makes sense, given that Site.find_for_request is doing the caching now...)
Deprecate SiteMiddleware

Hi,
I am still getting this error. using waigtail=2.8. can you tell me how to resolve it. please
when I comment the   'wagtail.core.middleware.SiteMiddleware',  'wagtail.contrib.redirects.middleware.RedirectMiddleware' middleware my existing site works fine.
Please tell me how to resolve it.

@rjsnh1522 There is no fix yet - we're still working on it.

@gasman  any workaround. ? I am using it with saleor. if there is no fix I will have to change lots of code at my end

Fixed in #5787


Docs: remove repeated "filesystems" for "NFS"

Signed-off-by: zouyu<EMAIL_ADDRESS>

Thanks for the PR, I think this reads better currently and the "are" needs to be proceeded by a plural.

Thanks for the PR, I think this reads better currently and the "are" needs to be proceeded by a plural.


Fix walreceiver reconnection attempts maintenance

@SomeoneToIgnore I see a branch fixing the same, feel free to choose version you like better.