Tutorial not working on teensy 4.1

Hardware description: Teensy 4.1
RTOS: Arduino
Version or commit hash:Foxy 2.0.2 and 1.0.0, Arduino 1.8.15 and 1.8.13, Teensyduino 1.55 and 1.53, Ubuntu 20.04LTS

The teensy tutorial is not working. Everything builds and loads properly, but when I start the ros2 serial agent, it appears to connect to the teensy and then crash out with no error messages. When this happens the teensy jumps into the error_loop and will just blink away forever.
I'm running Arduino 1.8.13, Teensyduino 1.53 and using a Teensy 4.1 board. I've used both the v2.0.2-foxy micro_ros_arduino release as well as v1.0.0 with the same results. I've also tried it with Arduino 1.8.15 and Teensyduino 1.55 and get the same results.
Here's the output from the micro ros agent terminal:
milner@canterbury:~/arduino-1.8.13/hardware/teensy/avr$ ros2 run micro_ros_agent micro_ros_agent serial --dev /dev/ttyACM0
[1637094118.227826] info     | TermiosAgentLinux.cpp | init                     | Serial port not found. | device: /dev/ttyACM0, error 2, waiting for connection...
[1637094119.231427] info     | TermiosAgentLinux.cpp | init                     | Serial port not found. | device: /dev/ttyACM0, error 2, waiting for connection...
[1637094120.234235] info     | TermiosAgentLinux.cpp | init                     | Serial port not found. | device: /dev/ttyACM0, error 2, waiting for connection...
[1637094121.237957] info     | TermiosAgentLinux.cpp | init                     | Serial port not found. | device: /dev/ttyACM0, error 2, waiting for connection...
[1637094122.239907] info     | TermiosAgentLinux.cpp | init                     | Serial port not found. | device: /dev/ttyACM0, error 2, waiting for connection...
[1637094123.242296] info     | TermiosAgentLinux.cpp | init                     | Serial port not found. | device: /dev/ttyACM0, error 2, waiting for connection...
[1637094124.245006] info     | TermiosAgentLinux.cpp | init                     | Serial port not found. | device: /dev/ttyACM0, error 2, waiting for connection...
[1637094125.247322] info     | TermiosAgentLinux.cpp | init                     | Serial port not found. | device: /dev/ttyACM0, error 2, waiting for connection...
[1637094126.250484] info     | TermiosAgentLinux.cpp | init                     | Serial port not found. | device: /dev/ttyACM0, error 2, waiting for connection...
[1637094127.251737] info     | TermiosAgentLinux.cpp | init                     | Serial port not found. | device: /dev/ttyACM0, error 2, waiting for connection...
[1637094128.253653] info     | TermiosAgentLinux.cpp | init                     | Serial port not found. | device: /dev/ttyACM0, error 2, waiting for connection...
[1637094129.255863] info     | TermiosAgentLinux.cpp | init                     | Serial port not found. | device: /dev/ttyACM0, error 2, waiting for connection...
[1637094130.085380] info     | TermiosAgentLinux.cpp | init                     | running...             | fd: 3
[1637094130.085572] info     | Root.cpp           | set_verbose_level        | logger setup           | verbose_level: 4
[1637094131.908440] info     | Root.cpp           | create_client            | create                 | client_key: 0x49E910CB, session_id: 0x81
[1637094131.908500] info     | SessionManager.hpp | establish_session        | session established    | client_key: 0x49E910CB, address: 0
milner@canterbury:~/arduino-1.8.13/hardware/teensy/avr$

Could you try to use the latest commit of the micro_ros_arduino repo & use the agent with:
docker run -it --rm --net=host -v /dev/shm:/dev/shm --privileged -v /dev:/dev microros/micro-ros-agent:galactic serial --dev /dev/serial/by-id/usb-Teensyduino_USB_Serial_8180040-if00 -v6

I have just tested Teensy 3.2 with the repo in d67c9dbe71644f004704914f2ce2e8dce5b0b94f (foxy) building with arduino-cli v0.1.8 and seems to work, I'm going to do some more tests.

Could you paste your log of the agent with the flag -v6?

I just tried on a fresh foxy ROS install and all examples are working fine. This could be related to your ROS installation, did you modify it in any way? What is your output for apt list --installed | grep fast?
Could you run the agent with the debug flag? like this:
ros2 run micro_ros_agent micro_ros_agent serial --dev /dev/ttyACM0 -v6
Anyway, you can try to run the dockerized agent, which should work out of the box.

I just tried re-checking out and building all of micro_ros and now its working.  Not sure if HEAD was broken for a few days or what, but it looks good now.  Thanks!

Hi, I followed this guide for getting MicroROS up and running on a Pi Pico, and succeeded! I was able to run echo the pico_publisher topic... once. It ran for a while, then I CTRL+C's out of the agent, and it stopped as expected... Only now when I try and run the dockerized agent I get the same "Serial port not found..." error that @carmiac reported.
Running Foxy on RPi4, Ubuntu 20.04 Server.

I thought maybe it was because I was running the docker agent with humble (didn't notice when I copy+pasted), so I pulled the foxy version and tried that, with the same result...

When I run apt list --installed | grep fast as per @pablogs9 I see:

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

libfastjson4/focal,now 0.99.8-2 arm64 [installed,automatic]
ros-foxy-fastcdr/focal,now 1.0.13-1focal.20210901.042734 arm64 [installed,automatic]
ros-foxy-fastrtps-cmake-module/focal,now 1.0.4-1focal.20210901.175217 arm64 [installed,automatic]
ros-foxy-fastrtps/focal,now 2.1.1-1focal.20220209.133847 arm64 [installed,automatic]
ros-foxy-rmw-fastrtps-cpp/focal,now 1.3.0-1focal.20220209.140958 arm64 [installed,automatic]
ros-foxy-rmw-fastrtps-shared-cpp/focal,now 1.3.0-1focal.20220209.140231 arm64 [installed,automatic]
ros-foxy-rosidl-typesupport-fastrtps-c/focal,now 1.0.4-1focal.20220209.135407 arm64 [installed,automatic]
ros-foxy-rosidl-typesupport-fastrtps-cpp/focal,now 1.0.4-1focal.20220209.135238 arm64 [installed,automatic]

And when I run the dockerized agent in debug mode with -v6 I see the same thing with no additional info.

I tried changing ports (USB3, USB2), reflashing the .uf2 file, purging modemmanager... No luck so far.

Would really appreciate some help on this! Thanks in advance.

@avielbr micro-ROS does not reconnect automatically by default. Check this example for reference: https://github.com/micro-ROS/micro_ros_arduino/blob/humble/examples/micro-ros_reconnection_example/micro-ros_reconnection_example.ino


[move] Standardize IR compiler main function (13)

Motivation
A small cleanup of the entry point of the compiler executable:

Honor the --no-verify option for scripts.
Flip "if not ... else" conditional to "if ... else".
Unify the helper functions and flow between the module and script path.

Testplan

CI/CD testcases will cover the above changes also

/canary

:sunny: Canary successful

/land


NTR peptidyl-arginine 3-dioxygenase activity

Could we have a new MF term for peptidyl-arginine 3-dioxygenase activity. The new term would be a sibling to peptidyl-lysine 3-dioxygenase activity #16632 (now GO:0106155 peptidyl-lysine 3-dioxygenase activity).
The reference for the new request is PMID 29563586. Proposed def: Catalysis of the reaction: protein L-arginine + 2-oxoglutarate + O2 = protein 3-hydroxy-L-arginine + succinate + CO2.
I think this is distinct from  GO:0102525 2-oxoglutarate, L-arginine oxygenase (succinate-forming) activity because that term looks like activity on free arginine while this one would apply to arginine residues in peptides.

Same ref as 16632?

No - 16632 (peptidyl-lysine-etc.) was PMID:29915238. This one is PMID:29563586. I'll e-mail you a PDF copy separately.

oops; committed already; will need to fix separetly; I didn't notice the PMID  here; argh

Done along with 16632
id: GO:0106156
+name: peptidyl-lysine 4-dioxygenase activity
+id: GO:0106157
+name: peptidyl-arginine 3-dioxygenase activity

RHEA for GO:0106157 is RHEA:56744  Already exists for GO:0140554 SAME reaction but a different name (L-arginine 3-hydrolyase activity)  (not indicating protein/peptide. );
RHEA for GO:0106156 is RHEA:57156

This slipped by me. Merge done.

Added EC:<IP_ADDRESS>


Attempting to get OfflineAudioContext.suspend to work

Hey @b-ma I could maybe use your help. I was trying to get suspend to work but I'm running into
Error: called `Result::unwrap()` on an `Err` value: Error { status: InvalidArg, reason: "", maybe_raw: 0x0, maybe_env: 0x0 }
    at OfflineAudioContext.startRendering (/Users/otto/Projects/node-web-audio-api-rs/monkey-patch.js:136:35)

This happens when the rust lib is trying to run the JsFunction
   4: node_web_audio_api_rs::offline_audio_context::_generated_suspend_and_generated_::{{closure}}
             at ./src/offline_audio_context.rs:506:9
   5: core::ops::function::FnOnce::call_once{{vtable.shim}}
             at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/core/src/ops/function.rs:250:5
   6: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
             at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/alloc/src/boxed.rs:2007:9
   7: web_audio_api::render::thread::RenderThread::render_audiobuffer_sync
             at /Users/otto/Projects/web-audio-api-rs/src/render/thread.rs:202:17

It is maybe because the function reference cannot be resolved. I'm trying to read https://nodejs.org/api/n-api.html#references-to-values-with-a-lifespan-longer-than-that-of-the-native-method but not sure if it is related and how to continue. Any ideas?

Note this requires the latest checkout of https://github.com/orottier/web-audio-api-rs/pull/407 to compile. Otherwise we need thread safe jsfunction which complicates things further.
Solving this issue might also pave the way for the event listeners?

Also note that I'm aware this is not spec compliant in its current form, but I have a plan to make ctx.suspend(..).then(..) work via dark magic next

Hey, I managed to make the callback run without crashing by using the ThreadSafeCallContext, but the callback is actually executed after startRendering is fully executed so the buffer is full of silence... need to investigate this further

Alright, ThreadSafeCallContext is the way to go because we need to revert https://github.com/orottier/web-audio-api-rs/pull/407/commits/1c6606825bf41a7bc5074f2535bd353838f34540 at some point.
Indeed strange the callback does not seem to run instantly. The rust lib correctly schedules the callback to execute on render quantum 173 but the next render quantum it does not notice any new audio graph messages to be handled.. Perhaps we need to look into how to make the call context blocking or so..

Assuming that the JsFunction is handed to the event loop, which is blocked by the actual execution of start_rendering_sync, it could be that we need another design. I maybe should look into a more spec compliant way of suspend where we don't resume immediately after the closure is run. Perhaps this allows the JsFunction to run in time (after suspend, before resume).
However we are between a rock and a hard place here because that means that start_rendering needs to be an async method in rust which will have a lot of impact because we then need to bring an async executor (e.g. tokio) inside the node bindings...
I have another design up my sleeve where we model the rust start_rendering method with a dedicated render thread and a simple shim of the Promise API on the rust side backed by https://crates.io/crates/oneshot
Might be able to sketch a solution for it in the next few days

Assuming that the JsFunction is handed to the event loop, which is blocked by the actual execution of start_rendering_sync, it could be that we need another design. I maybe should look into a more spec compliant way of suspend where we don't resume immediately after the closure is run. Perhaps this allows the JsFunction to run in time (after suspend, before resume).

Hum yup, that sounds quite logical indeed

However we are between a rock and a hard place here because that means that start_rendering needs to be an async method in rust which will have a lot of impact because we then need to bring an async executor (e.g. tokio) inside the node bindings...

No problem for me to go this way if you want to have a try, tokio is already integrated into napi-rs to handle async stuff from what I understand

Just wanted to let you know I am actually working on async rendering, but it is really hard. Async stuff is not my cup of tea

Seems to work like a charm! Really nice!

That's great news!
I will merge this (after a tiny bit of polishing) into the wpt branch, which we can also clean up a bit further to be merged into the main branch.

wpt branch, which we can also clean up a bit further to be merged into the main branch.

+1

Sorry, I just trashed the diff by merging main, didn't realize there was so much change to merge

Alright, continuing this work in #42 now


Original Matlab Code, different results

Hi,
I am using the code from http://dde.binghamton.edu/download/camera_fingerprint/ with the same options (wiener, crop_center, level=4, sigma=5) and obtaining different results. Have you checked if the code is fine?
Regards

I haven't compared with that implementation. Can you point to which specifically differs?

I believe he is saying the resulting fingerprint from your code differs from the fingerprint obtained in the referenced implementation. I was about to try and code a python implementation of this myself but was happy when I saw you already had. Honestly, I didn't really understand the formulas from the white paper although I wish I knew how to read them.
As long as the uniqueness is the same, both implementations would work fine for the intended purpose. If you are using two different implementations together and they fingerprints didn't match, I could see how this could be a problem.


feat(Archive/Imo): formalize IMO 1961q3

[x] depends on: #9881
[x] depends on: #9878

Is this PR ready for review?

Some docs are missing and I have no time to write them.

It appears to me that this PR is in a reasonably good shape and it would be more desirable to have it in Archive as-is instead of waiting for more documentation (it's also not clear to me what documentation is supposedly missing). I suggest
maintainer merge

bors r+


Feature Request: Sticky Keys

Hello,
I am very pleased with this application greatly. There is a feature I would love to have added and I don't think it will require too many lines of code. I am interested in adding a feature that retains the pressed state of the originally held button after releasing the newly pressed button.
https://youtu.be/Feny5bs2JCg?t=273
4:37 - 4:51
The following YouTube link is to a video that explains the feature I would love to have in detail. As such would be unnecessary to type it all out.
Thank you.

This should fix it:
`
// g++ -o SnapKey SnapKey.cpp -mwindows -std=c++11
#include <windows.h>
#include <shellapi.h>
#define ID_TRAY_APP_ICON                1001
#define ID_TRAY_EXIT_CONTEXT_MENU_ITEM  3000
#define WM_TRAYICON                     (WM_USER + 1)
// Global variables
bool keyA_pressed = false;
bool keyD_pressed = false;
bool keyA_was_pressed = false;
bool keyD_was_pressed = false;
HHOOK hHook = NULL;
NOTIFYICONDATA nid;
// Function declarations
LRESULT CALLBACK KeyboardProc(int nCode, WPARAM wParam, LPARAM lParam);
LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
void InitNotifyIconData(HWND hwnd);
int main()
{
// Create a named mutex
HANDLE hMutex = CreateMutex(NULL, TRUE, TEXT("SnapKeyMutex"));
if (GetLastError() == ERROR_ALREADY_EXISTS)
{
MessageBox(NULL, TEXT("SnapKey is already running!"), TEXT("Error"), MB_ICONINFORMATION | MB_OK);
return 1; // Exit the program
}
// Create a window class
WNDCLASSEX wc = {0};
wc.cbSize = sizeof(WNDCLASSEX);
wc.lpfnWndProc = WndProc;
wc.hInstance = GetModuleHandle(NULL);
wc.lpszClassName = TEXT("SnapKeyClass");

if (!RegisterClassEx(&wc)) {
    MessageBox(NULL, TEXT("Window Registration Failed!"), TEXT("Error"), MB_ICONEXCLAMATION | MB_OK);
    ReleaseMutex(hMutex);
    CloseHandle(hMutex);
    return 1;
}

// Create a window
HWND hwnd = CreateWindowEx(
    0,
    wc.lpszClassName,
    TEXT("SnapKey"),
    WS_OVERLAPPEDWINDOW,
    CW_USEDEFAULT, CW_USEDEFAULT, 240, 120,
    NULL, NULL, wc.hInstance, NULL);

if (hwnd == NULL) {
    MessageBox(NULL, TEXT("Window Creation Failed!"), TEXT("Error"), MB_ICONEXCLAMATION | MB_OK);
    ReleaseMutex(hMutex);
    CloseHandle(hMutex);
    return 1;
}

// Initialize and add the system tray icon
InitNotifyIconData(hwnd);

// Set the hook
hHook = SetWindowsHookEx(WH_KEYBOARD_LL, KeyboardProc, NULL, 0);
if (hHook == NULL)
{
    MessageBox(NULL, TEXT("Failed to install hook!"), TEXT("Error"), MB_ICONEXCLAMATION | MB_OK);
    ReleaseMutex(hMutex); // Release the mutex before exiting
    CloseHandle(hMutex); // Close the handle
    return 1;
}

// Message loop
MSG msg;
while (GetMessage(&msg, NULL, 0, 0))
{
    TranslateMessage(&msg);
    DispatchMessage(&msg);
}

// Unhook the hook
UnhookWindowsHookEx(hHook);

// Remove the system tray icon
Shell_NotifyIcon(NIM_DELETE, &nid);

// Release and close the mutex
ReleaseMutex(hMutex);
CloseHandle(hMutex);

return 0;

}
LRESULT CALLBACK KeyboardProc(int nCode, WPARAM wParam, LPARAM lParam)
{
if (nCode == HC_ACTION)
{
KBDLLHOOKSTRUCT *pKeyBoard = (KBDLLHOOKSTRUCT *)lParam;
switch (wParam)
{
case WM_KEYDOWN:
if (pKeyBoard->vkCode == 'A')
{
if (keyD_pressed)
{
// Release D
keyD_pressed = false;
keyD_was_pressed = true;
INPUT input = {0};
input.type = INPUT_KEYBOARD;
input.ki.wVk = 'D';
input.ki.dwFlags = KEYEVENTF_KEYUP;
SendInput(1, &input, sizeof(INPUT));
}
keyA_pressed = true;
keyA_was_pressed = false;
}
else if (pKeyBoard->vkCode == 'D')
{
if (keyA_pressed)
{
// Release A
keyA_pressed = false;
keyA_was_pressed = true;
INPUT input = {0};
input.type = INPUT_KEYBOARD;
input.ki.wVk = 'A';
input.ki.dwFlags = KEYEVENTF_KEYUP;
SendInput(1, &input, sizeof(INPUT));
}
keyD_pressed = true;
keyD_was_pressed = false;
}
break;
    case WM_KEYUP:
        if (pKeyBoard->vkCode == 'A')
        {
            keyA_pressed = false;
            if (keyD_was_pressed)
            {
                // Press D again
                keyD_was_pressed = false;
                keyD_pressed = true;
                INPUT input = {0};
                input.type = INPUT_KEYBOARD;
                input.ki.wVk = 'D';
                input.ki.dwFlags = 0;
                SendInput(1, &input, sizeof(INPUT));
            }
        }
        else if (pKeyBoard->vkCode == 'D')
        {
            keyD_pressed = false;
            if (keyA_was_pressed)
            {
                // Press A again
                keyA_was_pressed = false;
                keyA_pressed = true;
                INPUT input = {0};
                input.type = INPUT_KEYBOARD;
                input.ki.wVk = 'A';
                input.ki.dwFlags = 0;
                SendInput(1, &input, sizeof(INPUT));
            }
        }
        break;

    default:
        break;
    }
}
return CallNextHookEx(hHook, nCode, wParam, lParam);

}
void InitNotifyIconData(HWND hwnd)
{
memset(&nid, 0, sizeof(NOTIFYICONDATA));
nid.cbSize = sizeof(NOTIFYICONDATA);
nid.hWnd = hwnd;
nid.uID = ID_TRAY_APP_ICON;
nid.uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP;
nid.uCallbackMessage = WM_TRAYICON;

// Load the icon from the current directory
HICON hIcon = (HICON)LoadImage(NULL, TEXT("icon.ico"), IMAGE_ICON, 0, 0, LR_LOADFROMFILE);
if (hIcon)
{
    nid.hIcon = hIcon;
}
else
{
    // If loading the icon fails, fallback to a default icon
    nid.hIcon = LoadIcon(NULL, IDI_APPLICATION);
}

lstrcpy(nid.szTip, TEXT("SnapKey"));

Shell_NotifyIcon(NIM_ADD, &nid);

}
LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg)
{
case WM_TRAYICON:
if (lParam == WM_RBUTTONDOWN)
{
POINT curPoint;
GetCursorPos(&curPoint);
SetForegroundWindow(hwnd);
        // Create a context menu
        HMENU hMenu = CreatePopupMenu();
        AppendMenu(hMenu, MF_STRING, ID_TRAY_EXIT_CONTEXT_MENU_ITEM, TEXT("Exit SnapKey"));

        // Display the context menu
        TrackPopupMenu(hMenu, TPM_BOTTOMALIGN | TPM_LEFTALIGN, curPoint.x, curPoint.y, 0, hwnd, NULL);
        DestroyMenu(hMenu);
    }
    break;

case WM_COMMAND:
    if (LOWORD(wParam) == ID_TRAY_EXIT_CONTEXT_MENU_ITEM)
    {
        PostQuitMessage(0);
    }
    break;

case WM_DESTROY:
    PostQuitMessage(0);
    break;

default:
    return DefWindowProc(hwnd, msg, wParam, lParam);
}
return 0;

}
`

// g++ -o SnapKey SnapKey.cpp -mwindows -std=c++11

#include <windows.h>
#include <shellapi.h>

#define ID_TRAY_APP_ICON                1001
#define ID_TRAY_EXIT_CONTEXT_MENU_ITEM  3000
#define WM_TRAYICON                     (WM_USER + 1)

// Global variables
bool keyA_pressed = false;
bool keyD_pressed = false;
bool keyA_was_pressed = false;
bool keyD_was_pressed = false;
HHOOK hHook = NULL;
NOTIFYICONDATA nid;

// Function declarations
LRESULT CALLBACK KeyboardProc(int nCode, WPARAM wParam, LPARAM lParam);
LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
void InitNotifyIconData(HWND hwnd);

int main()
{
    // Create a named mutex
    HANDLE hMutex = CreateMutex(NULL, TRUE, TEXT("SnapKeyMutex"));
    if (GetLastError() == ERROR_ALREADY_EXISTS)
    {
        MessageBox(NULL, TEXT("SnapKey is already running!"), TEXT("Error"), MB_ICONINFORMATION | MB_OK);
        return 1; // Exit the program
    }

    // Create a window class
    WNDCLASSEX wc = {0};
    wc.cbSize = sizeof(WNDCLASSEX);
    wc.lpfnWndProc = WndProc;
    wc.hInstance = GetModuleHandle(NULL);
    wc.lpszClassName = TEXT("SnapKeyClass");

    if (!RegisterClassEx(&wc)) {
        MessageBox(NULL, TEXT("Window Registration Failed!"), TEXT("Error"), MB_ICONEXCLAMATION | MB_OK);
        ReleaseMutex(hMutex);
        CloseHandle(hMutex);
        return 1;
    }

    // Create a window
    HWND hwnd = CreateWindowEx(
        0,
        wc.lpszClassName,
        TEXT("SnapKey"),
        WS_OVERLAPPEDWINDOW,
        CW_USEDEFAULT, CW_USEDEFAULT, 240, 120,
        NULL, NULL, wc.hInstance, NULL);

    if (hwnd == NULL) {
        MessageBox(NULL, TEXT("Window Creation Failed!"), TEXT("Error"), MB_ICONEXCLAMATION | MB_OK);
        ReleaseMutex(hMutex);
        CloseHandle(hMutex);
        return 1;
    }

    // Initialize and add the system tray icon
    InitNotifyIconData(hwnd);

    // Set the hook
    hHook = SetWindowsHookEx(WH_KEYBOARD_LL, KeyboardProc, NULL, 0);
    if (hHook == NULL)
    {
        MessageBox(NULL, TEXT("Failed to install hook!"), TEXT("Error"), MB_ICONEXCLAMATION | MB_OK);
        ReleaseMutex(hMutex); // Release the mutex before exiting
        CloseHandle(hMutex); // Close the handle
        return 1;
    }

    // Message loop
    MSG msg;
    while (GetMessage(&msg, NULL, 0, 0))
    {
        TranslateMessage(&msg);
        DispatchMessage(&msg);
    }

    // Unhook the hook
    UnhookWindowsHookEx(hHook);

    // Remove the system tray icon
    Shell_NotifyIcon(NIM_DELETE, &nid);

    // Release and close the mutex
    ReleaseMutex(hMutex);
    CloseHandle(hMutex);

    return 0;
}

LRESULT CALLBACK KeyboardProc(int nCode, WPARAM wParam, LPARAM lParam)
{
    if (nCode == HC_ACTION)
    {
        KBDLLHOOKSTRUCT *pKeyBoard = (KBDLLHOOKSTRUCT *)lParam;
        switch (wParam)
        {
        case WM_KEYDOWN:
            if (pKeyBoard->vkCode == 'A')
            {
                if (keyD_pressed)
                {
                    // Release D
                    keyD_pressed = false;
                    keyD_was_pressed = true;
                    INPUT input = {0};
                    input.type = INPUT_KEYBOARD;
                    input.ki.wVk = 'D';
                    input.ki.dwFlags = KEYEVENTF_KEYUP;
                    SendInput(1, &input, sizeof(INPUT));
                }
                keyA_pressed = true;
                keyA_was_pressed = false;
            }
            else if (pKeyBoard->vkCode == 'D')
            {
                if (keyA_pressed)
                {
                    // Release A
                    keyA_pressed = false;
                    keyA_was_pressed = true;
                    INPUT input = {0};
                    input.type = INPUT_KEYBOARD;
                    input.ki.wVk = 'A';
                    input.ki.dwFlags = KEYEVENTF_KEYUP;
                    SendInput(1, &input, sizeof(INPUT));
                }
                keyD_pressed = true;
                keyD_was_pressed = false;
            }
            break;

        case WM_KEYUP:
            if (pKeyBoard->vkCode == 'A')
            {
                keyA_pressed = false;
                if (keyD_was_pressed)
                {
                    // Press D again
                    keyD_was_pressed = false;
                    keyD_pressed = true;
                    INPUT input = {0};
                    input.type = INPUT_KEYBOARD;
                    input.ki.wVk = 'D';
                    input.ki.dwFlags = 0;
                    SendInput(1, &input, sizeof(INPUT));
                }
            }
            else if (pKeyBoard->vkCode == 'D')
            {
                keyD_pressed = false;
                if (keyA_was_pressed)
                {
                    // Press A again
                    keyA_was_pressed = false;
                    keyA_pressed = true;
                    INPUT input = {0};
                    input.type = INPUT_KEYBOARD;
                    input.ki.wVk = 'A';
                    input.ki.dwFlags = 0;
                    SendInput(1, &input, sizeof(INPUT));
                }
            }
            break;

        default:
            break;
        }
    }
    return CallNextHookEx(hHook, nCode, wParam, lParam);
}

void InitNotifyIconData(HWND hwnd)
{
    memset(&nid, 0, sizeof(NOTIFYICONDATA));

    nid.cbSize = sizeof(NOTIFYICONDATA);
    nid.hWnd = hwnd;
    nid.uID = ID_TRAY_APP_ICON;
    nid.uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP;
    nid.uCallbackMessage = WM_TRAYICON;

    // Load the icon from the current directory
    HICON hIcon = (HICON)LoadImage(NULL, TEXT("icon.ico"), IMAGE_ICON, 0, 0, LR_LOADFROMFILE);
    if (hIcon)
    {
        nid.hIcon = hIcon;
    }
    else
    {
        // If loading the icon fails, fallback to a default icon
        nid.hIcon = LoadIcon(NULL, IDI_APPLICATION);
    }

    lstrcpy(nid.szTip, TEXT("SnapKey"));

    Shell_NotifyIcon(NIM_ADD, &nid);
}

LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
    switch (msg)
    {
    case WM_TRAYICON:
        if (lParam == WM_RBUTTONDOWN)
        {
            POINT curPoint;
            GetCursorPos(&curPoint);
            SetForegroundWindow(hwnd);

            // Create a context menu
            HMENU hMenu = CreatePopupMenu();
            AppendMenu(hMenu, MF_STRING, ID_TRAY_EXIT_CONTEXT_MENU_ITEM, TEXT("Exit SnapKey"));

            // Display the context menu
            TrackPopupMenu(hMenu, TPM_BOTTOMALIGN | TPM_LEFTALIGN, curPoint.x, curPoint.y, 0, hwnd, NULL);
            DestroyMenu(hMenu);
        }
        break;

    case WM_COMMAND:
        if (LOWORD(wParam) == ID_TRAY_EXIT_CONTEXT_MENU_ITEM)
        {
            PostQuitMessage(0);
        }
        break;

    case WM_DESTROY:
        PostQuitMessage(0);
        break;

    default:
        return DefWindowProc(hwnd, msg, wParam, lParam);
    }
    return 0;
}

Hi,
First of all, thank you very much for providing the code.
It's working better than the code I attempted earlier today.
However, there's an issue with key inputs in-game. When holding the 'A' key and tapping the 'D' key, then releasing 'A' first followed by 'D', the 'A' key is automatically registered in-game, causing the character to move left without the 'A' key being actually pressed.
The same issue occurs in reverse: holding 'D', then 'A', and releasing 'D' makes the character move right.
The bug appears in these scenarios:

Hold 'A' -> Hold 'D' -> Release 'A'
Hold 'D' -> Hold 'A' -> Release 'D'

Thanks again for your help!

Hi,
First of all, thank you very much for providing the code.
It's working better than the code I attempted earlier today.
However, there's an issue with key inputs in-game. When holding the 'A' key and tapping the 'D' key, then releasing 'A' first followed by 'D', the 'A' key is automatically registered in-game, causing the character to move left without the 'A' key being actually pressed.
The same issue occurs in reverse: holding 'D', then 'A', and releasing 'D' makes the character move right.
The bug appears in these scenarios:
Hold 'A' -> Hold 'D' -> Release 'A'
Hold 'D' -> Hold 'A' -> Release 'D'
Thanks again for your help!

I am pleased to inform you that I was actively seeking a solution to this issue, and your idea served as an excellent foundation. It perfectly aligned with what I was looking for, and I have made improvements to the code to address the existing bug. The code has been enhanced, and the previously encountered issue has been resolved.
Files

SnapKey.cpp: The main application source file.

config.txt: Configuration file for key bindings.

icon.ico: Icon displayed in the system tray.

debug.log: Log file for debug information (generated when debug mode is enabled).

Configuration
The key bindings can be customized by editing the config.txt file. The file should have the following format:
keyA=A
keyD=D

Here, keyA and keyD specify the keys to be managed by the application. By default, keyA is set to 'A' and keyD is set to 'D'. Change these values to match the keys you want to use.
How It Works

Initialization: When the application starts, it creates a named mutex to ensure only one instance is running. It also loads key bindings from the config.txt file.

System Tray Icon: The application adds an icon to the system tray. Right-clicking the icon brings up a context menu with options to exit the application. The debug mode is now controlled directly through the debugMode variable in the code, and there is no direct toggle in the system tray.

Keyboard Hook: A low-level keyboard hook is set up to monitor key presses and releases. The application tracks whether the configured keys are pressed and manages their states based on the current configuration.

Debug Mode: Debugging functionality is controlled internally by the debugMode variable in the .cpp file. When enabled, detailed information about key states and events is logged to debug.log. The system tray no longer has an option to toggle debug mode directly; it is managed based on the variable state.

Shutdown: When the application is closed, it cleans up resources, removes the tray icon, and closes the log file.

Debugging
To enable or disable debugging, set the debugMode variable to true or false in the SnapKey.cpp file. When debug mode is enabled, the application logs detailed information about key states and events to debug.log. Ensure that debug.log is in the same directory as the executable.
Note: A basic GUI for configuring the application and toggling debug mode will be pushed to this branch in the coming hours. This will provide a user-friendly interface for managing settings and debugging options.
Example Log Entries
Debug Mode Enabled: Debug mode enabled
Key A Pressed: Key A pressed keyA_pressed=true keyD_pressed=false keyA_was_first=true keyD_was_first=false keyA_released_by_program=false keyD_released_by_program=false
Key D Released by Program: Key D released by program keyA_pressed=true keyD_pressed=false keyA_was_first=true keyD_was_first=false keyA_released_by_program=false keyD_released_by_program=true

In the end, every time I tried to solve one part, another part was given, another structure would have to be made.

The toughest part is that one key remains pressed. This happens to me every time.
Hold 'A' -> Hold 'D' -> Release 'A' (while still holding 'D') -> "A" is active, without being physically pressed.
Hold 'D' -> Hold 'A' -> Release 'D'(while still holding 'A') -> "D" is active, without being physically pressed.
Did you encounter any issues while implementing the keybinding option?

I'm having the same problem with the provided code.
Hold 'A' -> Hold 'D' -> Release 'A' (while still holding 'D') -> "A" is active, without being physically pressed.
Hold 'D' -> Hold 'A' -> Release 'D'(while still holding 'A') -> "D" is active, without being physically pressed.
 The Sticky Key feature is now available in SnapKey version 1.1.4. Enjoy!
1.1.4 - 25/07/2024
Sticky Keys:

Introducing Sticky Keys, a feature that remembers the pressed state of the initially held button even after pressing another button.
For example, if you hold down a directional key like "A" and repeatedly tap the "D" key, each press of "D" will cancel "A" until "D" is released, and vice versa.

Special thanks to @minteeaa for making this possible.
Config:

Added more characters to the ASCII Code List.
Slightly adjusted the CFG file to enhance readability.


Why there are only _cpu.binarytxt file exist in my module folder after python -m pip install mediapipe

OS Platform and Distribution
Ubuntu 20.04
Compiler version
No response
Programming Language and version
Python 3.9
Installed using virtualenv? pip? Conda?(if python)
pip
MediaPipe version
0.10.14
Bazel version
No response
XCode and Tulsi versions (if iOS)
No response
Android SDK and NDK versions (if android)
No response
Android AAR (if android)
None
OpenCV version (if running on desktop)
No response
Describe the problem
python -m pip install mediapipe
Complete Logs
I want to use the face_landmarker model on GPU. But after I installed mediapipe, it occurs to me that in /modules/face_landmark folder, the only binarytxt file is face_landmark_front_cpu.binarypb, but shouldn't there be a face_landmark_front_gpu.binarypb file if I want to use solution on GPU? If so, how can I get such file.
Under this circumstance, I followed all the instruction from Face Landmarker Example Code: https://colab.research.google.com/github/googlesamples/mediapipe/blob/main/examples/face_landmarker/python/[MediaPipe_Python_Tasks]_Face_Landmarker.ipynb. I copied all the necessary code and change the based_option to be the following: base_options = python.BaseOptions(model_asset_path='/absolute/path/face_landmarker.task', delegate=mp.tasks.BaseOptions.Delegate.GPU). But after running this it shows the following error:ValueError: The model is not a valid Flatbuffer buffer. How can I fix this?

The following is my complete code:
import numpy as np
import mediapipe as mp
from mediapipe.tasks import python
from mediapipe.tasks.python import vision
from typing import Tuple, Union
import math
import cv2
import numpy as np
MARGIN = 10  # pixels
ROW_SIZE = 10  # pixels
FONT_SIZE = 1
FONT_THICKNESS = 1
TEXT_COLOR = (255, 0, 0)  # red
def _normalized_to_pixel_coordinates(
normalized_x: float, normalized_y: float, image_width: int,
image_height: int) -> Union[None, Tuple[int, int]]:
"""Converts normalized value pair to pixel coordinates."""
Checks if the float value is between 0 and 1.
def is_valid_normalized_value(value: float) -> bool:
return (value > 0 or math.isclose(0, value)) and (value < 1 or
math.isclose(1, value))
if not (is_valid_normalized_value(normalized_x) and
is_valid_normalized_value(normalized_y)):
# TODO: Draw coordinates even if it's outside of the image bounds.
return None
x_px = min(math.floor(normalized_x * image_width), image_width - 1)
y_px = min(math.floor(normalized_y * image_height), image_height - 1)
return x_px, y_px
def visualize(
image,
detection_result
) -> np.ndarray:
"""Draws bounding boxes and keypoints on the input image and return it.
Args:
image: The input RGB image.
detection_result: The list of all "Detection" entities to be visualize.
Returns:
Image with bounding boxes.
"""
annotated_image = image.copy()
height, width, _ = image.shape
for detection in detection_result.detections:
# Draw bounding_box
bbox = detection.bounding_box
start_point = bbox.origin_x, bbox.origin_y
end_point = bbox.origin_x + bbox.width, bbox.origin_y + bbox.height
cv2.rectangle(annotated_image, start_point, end_point, TEXT_COLOR, 3)
# Draw keypoints
for keypoint in detection.keypoints:
  keypoint_px = _normalized_to_pixel_coordinates(keypoint.x, keypoint.y,
                                                 width, height)
  color, thickness, radius = (0, 255, 0), 2, 2
  cv2.circle(annotated_image, keypoint_px, thickness, color, radius)

# Draw label and score
category = detection.categories[0]
category_name = category.category_name
category_name = '' if category_name is None else category_name
probability = round(category.score, 2)
result_text = category_name + ' (' + str(probability) + ')'
text_location = (MARGIN + bbox.origin_x,
                 MARGIN + ROW_SIZE + bbox.origin_y)
cv2.putText(annotated_image, result_text, text_location, cv2.FONT_HERSHEY_PLAIN,
            FONT_SIZE, TEXT_COLOR, FONT_THICKNESS)

return annotated_image
STEP 2: Create an FaceDetector object.
base_options = python.BaseOptions(model_asset_path='/absolute/path/face_landmarker.task', delegate=mp.tasks.BaseOptions.Delegate.GPU)
options = vision.FaceDetectorOptions(base_options=base_options)
detector = vision.FaceDetector.create_from_options(options)
STEP 3: Load the input image.
image = mp.Image.create_from_file('360_F_319108213_MoLZZt5WTXq6NpdG1FbCbyCtDStlSVBf.jpg')
STEP 4: Detect faces in the input image.
detection_result = detector.detect(image)
STEP 5: Process the detection result. In this case, visualize it.
image_copy = np.copy(image.numpy_view())
annotated_image = visualize(image_copy, detection_result)
rgb_annotated_image = cv2.cvtColor(annotated_image, cv2.COLOR_BGR2RGB)
cv2.imshow(rgb_annotated_image)

Hi @Terrywang2001,
It must support the GPU in Ubuntu, To better understand and address the issue, please provide the following:

The version of MediaPipe you are using.
The complete standalone code you are using.
The full error logs.

Thank you!!

the following is the screenshot of mediapipe/modules/face_landmark folder right after I run "python -m pip install mediapipe":

I don't know why there's no gpu.binarypb file inside this folder, and the same happened for all the folders in the module folder.
.
But the gpu folder still exists.

About the ValueError: The model is not a valid Flatbuffer buffer. I don't know why but it just resolved lol.

So the only code I used is 'python -m pip install mediapipe'. I installed this through my terminal, and when the download finished, only the cpu.binarytxt appeared, but not gpu.binarytxt.

Hi @Terrywang2001,
Could you please test this code using a GPU as the delegate? It works fine for me, and I would appreciate knowing if it works for you as well.
Visualization utilities
from mediapipe import solutions
from mediapipe.framework.formats import landmark_pb2
import numpy as np
import matplotlib.pyplot as plt

def draw_landmarks_on_image(rgb_image, detection_result):
  face_landmarks_list = detection_result.face_landmarks
  annotated_image = np.copy(rgb_image)

  # Loop through the detected faces to visualize.
  for idx in range(len(face_landmarks_list)):
    face_landmarks = face_landmarks_list[idx]

    # Draw the face landmarks.
    face_landmarks_proto = landmark_pb2.NormalizedLandmarkList()
    face_landmarks_proto.landmark.extend([
      landmark_pb2.NormalizedLandmark(x=landmark.x, y=landmark.y, z=landmark.z) for landmark in face_landmarks
    ])

    solutions.drawing_utils.draw_landmarks(
        image=annotated_image,
        landmark_list=face_landmarks_proto,
        connections=mp.solutions.face_mesh.FACEMESH_TESSELATION,
        landmark_drawing_spec=None,
        connection_drawing_spec=mp.solutions.drawing_styles
        .get_default_face_mesh_tesselation_style())
    solutions.drawing_utils.draw_landmarks(
        image=annotated_image,
        landmark_list=face_landmarks_proto,
        connections=mp.solutions.face_mesh.FACEMESH_CONTOURS,
        landmark_drawing_spec=None,
        connection_drawing_spec=mp.solutions.drawing_styles
        .get_default_face_mesh_contours_style())
    solutions.drawing_utils.draw_landmarks(
        image=annotated_image,
        landmark_list=face_landmarks_proto,
        connections=mp.solutions.face_mesh.FACEMESH_IRISES,
          landmark_drawing_spec=None,
          connection_drawing_spec=mp.solutions.drawing_styles
          .get_default_face_mesh_iris_connections_style())

  return annotated_image

def plot_face_blendshapes_bar_graph(face_blendshapes):
  # Extract the face blendshapes category names and scores.
  face_blendshapes_names = [face_blendshapes_category.category_name for face_blendshapes_category in face_blendshapes]
  face_blendshapes_scores = [face_blendshapes_category.score for face_blendshapes_category in face_blendshapes]
  # The blendshapes are ordered in decreasing score value.
  face_blendshapes_ranks = range(len(face_blendshapes_names))

  fig, ax = plt.subplots(figsize=(12, 12))
  bar = ax.barh(face_blendshapes_ranks, face_blendshapes_scores, label=[str(x) for x in face_blendshapes_ranks])
  ax.set_yticks(face_blendshapes_ranks, face_blendshapes_names)
  ax.invert_yaxis()

  # Label each bar with values
  for score, patch in zip(face_blendshapes_scores, bar.patches):
    plt.text(patch.get_x() + patch.get_width(), patch.get_y(), f"{score:.4f}", va="top")

  ax.set_xlabel('Score')
  ax.set_title("Face Blendshapes")
  plt.tight_layout()
  plt.show()

Running inference and visualizing the results
import mediapipe as mp
from mediapipe.tasks import python
from mediapipe.tasks.python import vision
import cv2

# STEP 2: Create an FaceLandmarker object.
base_options = python.BaseOptions(model_asset_path='/Users/kuaashish/Downloads/face_landmarker.task', delegate=mp.tasks.BaseOptions.Delegate.GPU)
options = vision.FaceLandmarkerOptions(base_options=base_options,
                                       output_face_blendshapes=True,
                                       output_facial_transformation_matrixes=True,
                                       num_faces=1)
detector = vision.FaceLandmarker.create_from_options(options)

# STEP 3: Load the input image.
image = mp.Image.create_from_file("/Users/kuaashish/Downloads/color_sketch.jpg")

# STEP 4: Detect face landmarks from the input image.
detection_result = detector.detect(image)

# STEP 5: Process the detection result. In this case, visualize it.
annotated_image = draw_landmarks_on_image(image.numpy_view(), detection_result)
cv2.imshow("Annotated_Image",cv2.cvtColor(annotated_image, cv2.COLOR_RGB2BGR))

Please adjust the task file path according to your OS and update the input image path accordingly.
Thank you!!

It works.

But still only cpu.binarytxt file exists.
recent:///d2581fa89ec054b27440152e66545567

Hi @Terrywang2001,
We are currently unaware of this file. Could you please provide the specific use case for this file? Understanding your requirements will help us address the issue more effectively.
Thank you!!

Oh it's because I want to use the prebuilt solution. So in the file "face_detection.py", at the beginning of the file, there are two lines: _SHORT_RANGE_GRAPH_FILE_PATH = 'mediapipe/modules/face_detection/face_detection_short_range_cpu.binarypb'
_FULL_RANGE_GRAPH_FILE_PATH = 'mediapipe/modules/face_detection/face_detection_full_range_cpu.binarypb'. And in it's init def, there's a line about the binary graph path: binary_graph_path = _FULL_RANGE_GRAPH_FILE_PATH if model_selection == 1 else _SHORT_RANGE_GRAPH_FILE_PATH. So I want to use GPU for the solution, and I thought there should be some file like face_detection_gpu.binarytxt.

Hi @Terrywang2001,
It appears you are still using our legacy face detection model instead of the new one, so there is no option to switch between the short-range and full-range models. We recommend using our new Task Face Landmarker API as example provided above. If you are missing a specific file, it may be because you need to build from source to obtain the gpu.binarypb file. You can try using a command similar to the one below:
bazel build -c opt --define MEDIAPIPE_DISABLE_GPU=1 //mediapipe/examples/desktop/face_detection:face_detection_gpu
Thank you!!


Add icons for Codeberg and Mastodon

Thanks a lot for Reactive-Resume. It's awesome!
I added two links to Profileswhere no icon is available yet. It would be cool if you add them:
Mastodon - https://joinmastodon.org/
Codeberg - https://codeberg.org/
Thank you very much

The new icons should be available as of v3.6.17.

Wow awesome. Are you also upgrading the web application? I use it there ... Thanks again for that cool service 😊

@andywenk Yes, the web app get updated to the latest version automatically when I make a GitHub release here :) The managed web app would always be my main priority.

awesome - thanks so much! ;-)


failed to install

Hello, I am very interested in the MAGPIE. I attempted to install it using conda but encountered some difficulties. Would it be possible for you to provide a public docker image of the MAGPIE?

Thank you for using MAGPIE! I have already provided Dockerfile in the repo.


How do I remove the application of the application list

Description

How do I remove the application of the application list
Environment

Pinpoint version:
OS, WAS, affected library, etc:
Additional details (e.g. how your collector/web is set up):
Ubuntu14.04
web,collector 1.6.0-RC2
agent 1.6.0

Additional Info

Hi @TimeStarRipple
There's a bunch of admin APIs available for this kind of housekeeping stuff in AdminController.
The one you're looking for is /admin/removeApplicationName taking in applicationName as a request parameter.
Note that you'll have to pass in an additional parameter password to call these admin APIs. The value is the one you configured in pinpoint-web.properties.

http://<IP_ADDRESS>:28080/admin/removeApplicationName?applicationName=MyTestPP
HTTP Status 404 - /admin/removeApplicationName
type Status report
message /admin/removeApplicationName
description The requested resource is not available.
Apache Tomcat/8.0.36
Thanks

I missed the .pinpoint extension from, sorry.
Fixed my comment above.

Is it possible to just remove one agentid? Because after I changed the agentId, the old one still shows on the inspector.

@angeloudy
you can to use following rest api
/admin/removeAgentId.pinpoint?applicationName=&agentId=

i am getting "Missing password"

@altiankur  i am getting "Missing password" too, can u fix this?

@Rnic
Please refer to https://github.com/naver/pinpoint/wiki/FAQ#how-do-i-delete-application-name-andor-agent-id-from-hbase.

@Xylus thank you for your help !

@Xylus thank you for your help !

Oh, I have the same problem as you. What is the initial password? I don't remember I set it。

@gongjiang1
Note that the value for the password parameter is what you defined admin.password property in pinpoint-web.properties. Leaving this blank will allow you to call admin APIs without the password parameter.

@gongjiang1
Note that the value for the password parameter is what you defined admin.password property in pinpoint-web.properties. Leaving this blank will allow you to call admin APIs without the password parameter.

thx

@altiankur i am getting "Missing password" too, can u fix this?

http://server:port/pinpoint-web-1.7.1/admin/removeApplicationName.pinpoint?applicationName=ACH-two&password=admin,  it works


need to update the to_dict for comparing

opening for visibility
JIRA Ticket

https://ihm-it.atlassian.net/browse/IHRACP-4401

Description

Creating a no henson episode ingestion service. Updating to_dict method for conversion and comparison in episode ingestion

Major Changes:
Dict method updates for comparing against database data and change the object struct
###Related PRS
https://github.com/iheartradio/episodeingestion/pull/1
https://github.com/iheartradio/pyPodcastParser/pull/9
https://github.com/iheartradio/ingestion-talk/pull/148
https://github.com/iheartradio/podcast-utils/pull/31
Modified: (config files not tracked by git)
ingestion deployment
ingestion talk
discern.

TODO: Update uts

File "/Users/kellymcgaw/.pyenv/versions/3.9.11/envs/revise/lib/python3.9/site-packages/pypodcastparser/Item.py", line 173, in set_description
self.description =  p.sub('', tag.string)
TypeError: expected string or bytes-like object
issue in revise with 1.4.0

Major Fields to verify after updates:
explicit
duration
pu date

Maybe we store the numbers such as 32767, -32767 and possibly 3600, 60 as constants. That way we get a little more info on what they are from the name, and it makes it easier to update them later if need be.

logic was exported to episode ingestion


[Bug]: Users can skip signup form if they hit enter on the keyboard

Is there an existing issue for this?

[X] I have searched the existing issues

Description
When a user signs up for a new account, they can bypass the welcome form by selecting other, and hit enter
Steps To Reproduce

Create a new account
Select other
Hit enter and observe
https://user-images.githubusercontent.com/20532920/230614241-3fb69784-9324-43b8-b76f-84220c1707c9.mov

Public Sample App
No response
Environment
Production
Issue video log
No response
Version
Cloud v1.9.16

This is fixed, verified it on the DP url. User is not able to skip the signup form when they hit enter from the keyboard.

This is fixed verified it on release.


Fix app slowness

App gets really slow e.g. when havainnoijat field is edited, and maybe occasionally also while app is just open on a tab (unconfirmed).

@mikkohei13 Can be tested here https://lintuasema-dev-new.2.rahtiapp.fi/#/ (the old version is still here for comparison: https://lintuasema-dev.2.rahtiapp.fi/#/). I fixed the slowness on the "Day details" page, didn't notice slowness elsewhere


Ice is sublimated twice

The value calculated for sublimation is subtracted from the snow layer ice content twice.
First in Snow_Env::updateDailySurfFlux()
    if (currl->isSnow && sublim>0.) {
        double layicermv = fmin(sublim, currl->ice);
        actsub += layicermv;
        sublim -= layicermv;
        **currl->ice -= layicermv;**
    }

And then again in Ground::constructSnowLayers()
    if(toplayer->isSnow) {
        toplayer->dz *= ((toplayer->ice -ablat)/(toplayer->ice));
        **toplayer->ice -= ablat;**
    }

layicermv and ablat are the same value in different scopes.

The solution will be to remove the statement in updateDailySurfFlux. Implementing this will happen when we create a branch to fix the SNOWTHICK issue.

Fixed by PR #372


[Bug]: cancelSwapRequest failing.

Data Provider
Blockfrost
DEX
SundaeSwap
Description
When using the following code to cancel a swap request, that was sitting in Sundaeswap as out of range.
dexter.newCancelSwapRequest().forTransaction(transactionId).forDex(dexName).cancel();
The below error was received, I subscribed to the onSigning and logged out the error below.
I can replicate this each time on Sundae, I haven't tested any other dex as of yet, will update this when I do.

I got the same error on Minswap

@Sluder Hi Is cancel swap request working well?

@ndtr2000 @dpbeaumont I'm taking a look at this today

@dpbeaumont can you share more about how you workaround with that, may be a piece of code?

@dpbeaumont hi, can you help me on the cancel one


Fix import in Python getting-started

resolves #633

@lovesh I think I made some confusion with the commits, but now the imports are absolute, the src directory is a module and I added some info in README.md about how to run a script inside a module.


Tag new versions

Many people (including me) use dep or similar tools to manage dependencies in their projects. The new Go 1.11 modules feature also requires tagging packages using SemVer.
The last release of this repo is dated November 2016. Can you please tag your master branch periodically? We have no indication of how the APIs are changing and by default any dependency manager will pull the last tagged release (2 years old).

I added to change mime to use the master branch.
By the way how is the project, is it still active, do you need any help with it?


Update download script to add parallelism, correct locking, and specific version support.

I took a crack at updating the download script to download plugins in parallel and also added a way to specify a specific version of a plugin with an optional @version.
Assumptions from script retained:

REF and JENKINS_UC can be passed in from the environment.
Failing to download a plugin returns a non-zero exit code from the script as a whole, failing the docker build.
Plugin dependencies are only resolved once, and are resolved at the latest version of the plugin regardless of dependency metadata.
Plugins all have .hpi as the extension.
Plugin dependencies are resolved from each plugin's META-INF/MANIFEST.MF
-plugin is appeded to any plugin names before plugin downloading is considered "failed".
EDIT: Plugin .hpi files placed in REF directory cause a dependency of the same name to skip downloading, and their dependencies are then resolved.

New Features:

Increased performance using parallelism and unzip -p instead of jrunscript.
Specifying a plugin as install-plugins.sh plugin:version will pull the plugin from $JENKINS_UC/download/plugins/$plugin/$version/${plugin}.hpi instead of $JENKINS_UC/latest/${plugin}.hpi
Uses simple directory-based atomic locking to avoid race conditions.
EDIT: Uses zip -T to check the integrity of each downloaded .hpi to make sure jenkins can unzip it.

Two things to note:

MANIFEST.MF files have a ^M in them, and long manifest entries are truncated and continued on the next line if too long.  Ugly sed -> tr -> sed -> tr piping is used to remove the ^M and concatenate lines so no plugin dependencies are missed. Although ugly, this still seems preferable to jrunscript.
Because backgrounding is used to resolve dependencies in parallel, all dependencies must finish downloading before the script realizes that there are failures (i.e. it can't exit prematurely).  Since backgrounding is such a huge performance gain for the happy path, this seems to be acceptable.

Downloading plugins...
Downloading plugin: credentials from https://updates.jenkins-ci.org/download/plugins/credentials/2.1.2/credentials.hpi
Downloading plugin: slack from https://updates.jenkins-ci.org/latest/slack.hpi
Downloading plugin: docker-traceability from https://updates.jenkins-ci.org/latest/docker-traceability.hpi
Downloading plugin: amazon-ecs from https://updates.jenkins-ci.org/latest/amazon-ecs.hpi
Downloading plugin: ec2 from https://updates.jenkins-ci.org/latest/ec2.hpi
Downloading plugin: github from https://updates.jenkins-ci.org/latest/github.hpi
Downloading plugin: bitbucket from https://updates.jenkins-ci.org/latest/bitbucket.hpi
Downloading plugin: workflow-aggregator from https://updates.jenkins-ci.org/latest/workflow-aggregator.hpi
Downloading plugin: ssh-credentials from https://updates.jenkins-ci.org/latest/ssh-credentials.hpi
Downloading plugin: antisamy-markup-formatter from https://updates.jenkins-ci.org/latest/antisamy-markup-formatter.hpi
Downloading plugin: git from https://updates.jenkins-ci.org/latest/git.hpi
Downloading plugin: pipeline-utility-steps from https://updates.jenkins-ci.org/latest/pipeline-utility-steps.hpi
Downloading plugin: docker from https://updates.jenkins-ci.org/latest/docker.hpi
Downloading plugin: pipeline-stage-view from https://updates.jenkins-ci.org/latest/pipeline-stage-view.hpi
Downloading plugin: docker-workflow from https://updates.jenkins-ci.org/latest/docker-workflow.hpi
Downloading plugin: github-branch-source from https://updates.jenkins-ci.org/latest/github-branch-source.hpi
Downloading plugin: favorite from https://updates.jenkins-ci.org/latest/favorite.hpi
Downloading plugin: docker-plugin from https://updates.jenkins-ci.org/latest/docker-plugin.hpi
 > workflow-aggregator depends on workflow-scm-step:2.0,pipeline-stage-view:1.3,pipeline-build-step:2.0,workflow-durable-task-step:2.0,pipeline-stage-step:2.0,workflow-api:2.0,workflow-step-api:2.0,workflow-support:2.0,workflow-basic-steps:2.0,pipeline-input-step:2.0,workflow-job:2.0,workflow-cps-global-lib:2.0,workflow-cps:2.0,workflow-multibranch:2.0
Downloading plugin: workflow-scm-step from https://updates.jenkins-ci.org/latest/workflow-scm-step.hpi
Downloading plugin: pipeline-build-step from https://updates.jenkins-ci.org/latest/pipeline-build-step.hpi
Downloading plugin: workflow-durable-task-step from https://updates.jenkins-ci.org/latest/workflow-durable-task-step.hpi
Downloading plugin: pipeline-stage-step from https://updates.jenkins-ci.org/latest/pipeline-stage-step.hpi
Downloading plugin: workflow-api from https://updates.jenkins-ci.org/latest/workflow-api.hpi
Downloading plugin: workflow-step-api from https://updates.jenkins-ci.org/latest/workflow-step-api.hpi
Downloading plugin: workflow-support from https://updates.jenkins-ci.org/latest/workflow-support.hpi
Downloading plugin: workflow-basic-steps from https://updates.jenkins-ci.org/latest/workflow-basic-steps.hpi
Downloading plugin: workflow-job from https://updates.jenkins-ci.org/latest/workflow-job.hpi
Downloading plugin: pipeline-input-step from https://updates.jenkins-ci.org/latest/pipeline-input-step.hpi
Downloading plugin: workflow-cps-global-lib from https://updates.jenkins-ci.org/latest/workflow-cps-global-lib.hpi
Downloading plugin: workflow-cps from https://updates.jenkins-ci.org/latest/workflow-cps.hpi
Downloading plugin: workflow-multibranch from https://updates.jenkins-ci.org/latest/workflow-multibranch.hpi
 > ssh-credentials depends on credentials:1.21
 > favorite depends on token-macro:1.5.1;resolution:=optional
Skipping optional dependency token-macro
 > docker-workflow depends on workflow-step-api:1.13,workflow-cps:1.13,script-security:1.17,docker-commons:1.3.1
Downloading plugin: script-security from https://updates.jenkins-ci.org/latest/script-security.hpi
Downloading plugin: docker-commons from https://updates.jenkins-ci.org/latest/docker-commons.hpi
 > 'antisamy-markup-formatter' has no dependencies
 > github-branch-source depends on credentials:1.22,github:1.14.0,scm-api:1.2,github-api:1.75,git:2.3
 > pipeline-input-step depends on workflow-support:1.15,workflow-step-api:1.15
Downloading plugin: scm-api from https://updates.jenkins-ci.org/latest/scm-api.hpi
Downloading plugin: github-api from https://updates.jenkins-ci.org/latest/github-api.hpi
 > pipeline-stage-step depends on workflow-api:1.15
 > pipeline-build-step depends on workflow-support:1.15,workflow-api:1.15
 > workflow-api depends on workflow-step-api:1.15
 > workflow-job depends on workflow-support:2.1
 > workflow-step-api depends on structs:1.1
Downloading plugin: structs from https://updates.jenkins-ci.org/latest/structs.hpi
 > workflow-durable-task-step depends on workflow-step-api:1.15,durable-task:1.5,workflow-support:2.1,workflow-api:2.1
Downloading plugin: durable-task from https://updates.jenkins-ci.org/latest/durable-task.hpi
 > workflow-basic-steps depends on workflow-step-api:1.15,workflow-api:1.15,mailer:1.13
Downloading plugin: mailer from https://updates.jenkins-ci.org/latest/mailer.hpi
 > 'scm-api' has no dependencies
 > ec2 depends on aws-credentials:1.11,node-iterator-api:1.5,aws-java-sdk:1.10.45
Downloading plugin: aws-credentials from https://updates.jenkins-ci.org/latest/aws-credentials.hpi
Downloading plugin: aws-java-sdk from https://updates.jenkins-ci.org/latest/aws-java-sdk.hpi
Downloading plugin: node-iterator-api from https://updates.jenkins-ci.org/latest/node-iterator-api.hpi
 > bitbucket depends on git:2.3.5,job-dsl:1.40;resolution:=optional,mercurial:1.54
Skipping optional dependency job-dsl
Downloading plugin: mercurial from https://updates.jenkins-ci.org/latest/mercurial.hpi
 > 'durable-task' has no dependencies
 > 'structs' has no dependencies
 > workflow-scm-step depends on workflow-step-api:1.15,git-client:1.19.0
Downloading plugin: git-client from https://updates.jenkins-ci.org/latest/git-client.hpi
 > docker-commons depends on authentication-tokens:1.1,icon-shim:1.0.3,credentials:1.22
Downloading plugin: authentication-tokens from https://updates.jenkins-ci.org/latest/authentication-tokens.hpi
Downloading plugin: icon-shim from https://updates.jenkins-ci.org/latest/icon-shim.hpi
 > 'script-security' has no dependencies
 > 'node-iterator-api' has no dependencies
 > workflow-support depends on script-security:1.16,workflow-step-api:1.15,workflow-api:2.1
 > 'credentials' has no dependencies
 > 'mailer' has no dependencies
 > workflow-cps-global-lib depends on workflow-cps:1.15,git-server:1.5
Downloading plugin: git-server from https://updates.jenkins-ci.org/latest/git-server.hpi
 > authentication-tokens depends on credentials:1.22
 > 'icon-shim' has no dependencies
 > pipeline-stage-view depends on jquery-detached:1.1.1,momentjs:1.1,handlebars:1.1,pipeline-rest-api:1.4,workflow-job:1.14
Downloading plugin: jquery-detached from https://updates.jenkins-ci.org/latest/jquery-detached.hpi
Downloading plugin: momentjs from https://updates.jenkins-ci.org/latest/momentjs.hpi
Downloading plugin: handlebars from https://updates.jenkins-ci.org/latest/handlebars.hpi
Downloading plugin: pipeline-rest-api from https://updates.jenkins-ci.org/latest/pipeline-rest-api.hpi
 > workflow-multibranch depends on cloudbees-folder:5.10,workflow-cps:2.3,branch-api:1.10,scm-api:1.1,workflow-job:1.15
Downloading plugin: cloudbees-folder from https://updates.jenkins-ci.org/latest/cloudbees-folder.hpi
Downloading plugin: branch-api from https://updates.jenkins-ci.org/latest/branch-api.hpi
 > amazon-ecs depends on aws-credentials:1.10,aws-java-sdk:1.10.45
 > git-server depends on git-client:1.11.0
 > slack depends on workflow-step-api:1.11,junit:1.3
Downloading plugin: junit from https://updates.jenkins-ci.org/latest/junit.hpi
 > 'momentjs' has no dependencies
 > 'handlebars' has no dependencies
 > 'jquery-detached' has no dependencies
 > git depends on workflow-scm-step:1.14.2,promoted-builds:2.25;resolution:=optional,matrix-project:1.6,ssh-credentials:1.11,credentials:1.25,git-client:1.19.6,mailer:1.16,token-macro:1.11;resolution:=optional,scm-api:1.0,parameterized-trigger:2.4;resolution:=optional
Skipping optional dependency promoted-builds
Downloading plugin: matrix-project from https://updates.jenkins-ci.org/latest/matrix-project.hpi
 > branch-api depends on scm-api:1.2,cloudbees-folder:5.10
 > github depends on github-api:1.69,credentials:1.22,plain-credentials:1.1,token-macro:1.11,git:2.4.0
Skipping optional dependency token-macro
Downloading plugin: plain-credentials from https://updates.jenkins-ci.org/latest/plain-credentials.hpi
Skipping optional dependency parameterized-trigger
Downloading plugin: token-macro from https://updates.jenkins-ci.org/latest/token-macro.hpi
 > mercurial depends on credentials:1.9.4,scm-api:0.1,matrix-project:1.2,multiple-scms:0.4-beta-1;resolution:=optional,ssh-credentials:1.6
Skipping optional dependency multiple-scms
 > pipeline-utility-steps depends on script-security:1.17,workflow-cps:1.11,workflow-step-api:1.11
 > cloudbees-folder depends on credentials:2.0.4;resolution:=optional
Skipping optional dependency credentials
 > aws-credentials depends on aws-java-sdk:1.10.16,credentials:1.22,credentials-binding:1.7
Downloading plugin: credentials-binding from https://updates.jenkins-ci.org/latest/credentials-binding.hpi
 > plain-credentials depends on credentials:1.21
 > workflow-cps depends on jquery-detached:1.2.1,script-security:1.18,workflow-api:2.1,workflow-support:2.1,scm-api:1.1,ace-editor:1.0.1,workflow-scm-step:1.15,workflow-step-api:2.1
Downloading plugin: ace-editor from https://updates.jenkins-ci.org/latest/ace-editor.hpi
 > 'token-macro' has no dependencies
 > matrix-project depends on script-security:1.13,junit:1.2
 > 'junit' has no dependencies
 > git-client depends on ssh-credentials:1.11
 > credentials-binding depends on plain-credentials:1.0,workflow-step-api:1.7,credentials:1.23
 > 'github-api' has no dependencies
 > pipeline-rest-api depends on workflow-job:1.14,pipeline-input-step:2.0;resolution:=optional
Skipping optional dependency pipeline-input-step
 > 'ace-editor' has no dependencies
 > docker-plugin depends on token-macro:1.7;resolution:=optional,ssh-slaves:1.6,durable-task:1.3
Skipping optional dependency token-macro
Downloading plugin: ssh-slaves from https://updates.jenkins-ci.org/latest/ssh-slaves.hpi
 > docker-traceability depends on docker-commons:1.0

Cleaning up locks...
removed directory: '/usr/share/jenkins/ref/plugins/ace-editor.lock'
removed directory: '/usr/share/jenkins/ref/plugins/amazon-ecs.lock'
removed directory: '/usr/share/jenkins/ref/plugins/antisamy-markup-formatter.lock'
removed directory: '/usr/share/jenkins/ref/plugins/authentication-tokens.lock'
removed directory: '/usr/share/jenkins/ref/plugins/aws-credentials.lock'
removed directory: '/usr/share/jenkins/ref/plugins/aws-java-sdk.lock'
removed directory: '/usr/share/jenkins/ref/plugins/bitbucket.lock'
removed directory: '/usr/share/jenkins/ref/plugins/branch-api.lock'
removed directory: '/usr/share/jenkins/ref/plugins/cloudbees-folder.lock'
removed directory: '/usr/share/jenkins/ref/plugins/credentials-binding.lock'
removed directory: '/usr/share/jenkins/ref/plugins/credentials.lock'
removed directory: '/usr/share/jenkins/ref/plugins/docker-commons.lock'
removed directory: '/usr/share/jenkins/ref/plugins/docker-traceability.lock'
removed directory: '/usr/share/jenkins/ref/plugins/docker-workflow.lock'
removed directory: '/usr/share/jenkins/ref/plugins/docker.lock'
removed directory: '/usr/share/jenkins/ref/plugins/durable-task.lock'
removed directory: '/usr/share/jenkins/ref/plugins/ec2.lock'
removed directory: '/usr/share/jenkins/ref/plugins/favorite.lock'
removed directory: '/usr/share/jenkins/ref/plugins/git-client.lock'
removed directory: '/usr/share/jenkins/ref/plugins/git-server.lock'
removed directory: '/usr/share/jenkins/ref/plugins/git.lock'
removed directory: '/usr/share/jenkins/ref/plugins/github-api.lock'
removed directory: '/usr/share/jenkins/ref/plugins/github-branch-source.lock'
removed directory: '/usr/share/jenkins/ref/plugins/github.lock'
removed directory: '/usr/share/jenkins/ref/plugins/handlebars.lock'
removed directory: '/usr/share/jenkins/ref/plugins/icon-shim.lock'
removed directory: '/usr/share/jenkins/ref/plugins/jquery-detached.lock'
removed directory: '/usr/share/jenkins/ref/plugins/junit.lock'
removed directory: '/usr/share/jenkins/ref/plugins/mailer.lock'
removed directory: '/usr/share/jenkins/ref/plugins/matrix-project.lock'
removed directory: '/usr/share/jenkins/ref/plugins/mercurial.lock'
removed directory: '/usr/share/jenkins/ref/plugins/momentjs.lock'
removed directory: '/usr/share/jenkins/ref/plugins/node-iterator-api.lock'
removed directory: '/usr/share/jenkins/ref/plugins/pipeline-build-step.lock'
removed directory: '/usr/share/jenkins/ref/plugins/pipeline-input-step.lock'
removed directory: '/usr/share/jenkins/ref/plugins/pipeline-rest-api.lock'
removed directory: '/usr/share/jenkins/ref/plugins/pipeline-stage-step.lock'
removed directory: '/usr/share/jenkins/ref/plugins/pipeline-stage-view.lock'
removed directory: '/usr/share/jenkins/ref/plugins/pipeline-utility-steps.lock'
removed directory: '/usr/share/jenkins/ref/plugins/plain-credentials.lock'
removed directory: '/usr/share/jenkins/ref/plugins/scm-api.lock'
removed directory: '/usr/share/jenkins/ref/plugins/script-security.lock'
removed directory: '/usr/share/jenkins/ref/plugins/slack.lock'
removed directory: '/usr/share/jenkins/ref/plugins/ssh-credentials.lock'
removed directory: '/usr/share/jenkins/ref/plugins/ssh-slaves.lock'
removed directory: '/usr/share/jenkins/ref/plugins/structs.lock'
removed directory: '/usr/share/jenkins/ref/plugins/token-macro.lock'
removed directory: '/usr/share/jenkins/ref/plugins/workflow-aggregator.lock'
removed directory: '/usr/share/jenkins/ref/plugins/workflow-api.lock'
removed directory: '/usr/share/jenkins/ref/plugins/workflow-basic-steps.lock'
removed directory: '/usr/share/jenkins/ref/plugins/workflow-cps-global-lib.lock'
removed directory: '/usr/share/jenkins/ref/plugins/workflow-cps.lock'
removed directory: '/usr/share/jenkins/ref/plugins/workflow-durable-task-step.lock'
removed directory: '/usr/share/jenkins/ref/plugins/workflow-job.lock'
removed directory: '/usr/share/jenkins/ref/plugins/workflow-multibranch.lock'
removed directory: '/usr/share/jenkins/ref/plugins/workflow-scm-step.lock'
removed directory: '/usr/share/jenkins/ref/plugins/workflow-step-api.lock'
removed directory: '/usr/share/jenkins/ref/plugins/workflow-support.lock'

+1

@carlossg I updated the script to use : instead of @.

Also, it seems like updates.jenkins-ci.org frequently has broken links to the latest version of plugins - possibly between release and upload?  For example, this afternoon, the updates url http://updates.jenkins-ci.org/latest/workflow-aggregator.hpi links to http://archives.jenkins-ci.org/plugins/workflow-aggregator/2.2/workflow-aggregator.hpi, which gives the following 404:
Not Found

The requested URL /plugins/workflow-aggregator/2.2/workflow-aggregator.hpi was not found on this server.

http://archives.jenkins-ci.org/plugins/workflow-aggregator/latest/workflow-aggregator.hpi, however, downloads the latest version in the archives (in this case, 2.1).  If updates.jenkins-ci.org is going to be frequently broken, should I just change the script to pull the latest version that actually exists in the archives?

Awesome thanks!

Thank you!


Speed up whitelist rules processing for jsfilter, htmlfilter

Additionally, in cssfilter we can walk through the generic rules only once.

/core/pull-requests/637


nvm_get_arch()  is buggy, install fails based on hostname

Just tried to install nvm/nodejs on an ARM server from scaleway.
No matter what I tried it ALWAYS installed the x86 version. After some investigation the culprit seems to be nvm_get_arch() :
nvm_get_arch() {
  local NVM_UNAME
  NVM_UNAME="$(uname -a)"
  local NVM_ARCH
  case "$NVM_UNAME" in
    *x86_64*) NVM_ARCH=x64 ;;
    *i*86*) NVM_ARCH=x86 ;;
    *) NVM_ARCH="$(uname -m)" ;;
  esac
  echo "$NVM_ARCH"
}

NVM_UNAME is the result of uname -a  containing also the hostname, and unfortunately  the automatic hostname I got is scw-1ea886 and the full uname -a is
Linux scw-1ea886 3.19.1-182 #1 SMP Mon Mar 16 13:16:51 UTC 2015 armv7l armv7l armv7l GNU/Linux

The i from Linux obviously matched with the 86 at the end of the hostname at the *i*86*)  case, thus returning the incorrect architecture.
I think
NVM_UNAME="$(uname -a)"

should be changed to
NVM_UNAME="$(uname -m)"

to avoid corner cases like this.

Thanks, this is a very detailed issue report!
My only concern with switching to uname -m is that it seems so obviously better that I'm not sure why it wasn't used to get the architecture in the first place. The only reason that makes sense to me is that uname -m may not have the same full shell/OS support as uname -a.
I'd be stoked on switching this, as soon as there's been investigation/verification that uname -m will work broadly.
On my Yosemite Mac, uname -m indeed prints the last section of uname -a, and the manpage documentation implies that's how it should always work anywhere.


Remove unneeded dependency on NettyRequest

This PR removes the dependency on Netty4HttpRequest in XFFResolver which is not required.

@jcantrill thx
Can you pls also remove the org.elasticsearch.http.netty4.Netty4HttpRequest import?

@floragunncom done

thx, pls. also for XFFResolver.java

@floragunncom done

@floragunncom bump...  possible to get this merged and released into a 5.6.10 release?

This will be merged soon and we can also prepare a 5.6.10 release. Thanks!

Search Guard 5.6.10-19.2 is released


Allow 'compact' code with newlines between global statements

Quite often I see minified code that puts individual statements at the global level on different lines.
For example:
function a() { ... }
function b() { ... function c() { ... }  }
var x;

Unfortunately right now it looks like escodegen only does:
function a() { ... }function b() { ... function c() { ... }  }var x;

or adds newlines everywhere.
A semi-compact option would be great, and I've had some success doing this by adding a special newline variable that only gets added from Syntax.Program.
Is this something of interest? I can produce a PR?

Why is this useful?

In my case, I'm using escodegen to create minified code to send to a microcontroller running JS (Espruino). It interprets each function as it gets it after a newline is received - effectively as if it were entered by a user in a REPL.
If everything is in one line, you end up with several thousand characters to execute in one go, which fills up all the available memory and breaks things.


refactor: use createBootstrap replace createApp

处理适配 bootstrap 的一些问题

[x] 1、调整 entryFile 下 createApp 为 createBootstrap
[x] 2、处理下模拟的 http 网关，res.send 如果参数是数组，express 会默认当成状态码导致报错
[ ] 3、bootstrap dev 的 console 输出被吞了，需要透出
[ ] 4、bootstrap 下，需要展示实际的每个框架的启动信息，比如端口等等，要优化下

Codecov Report

Merging #86 (6f03865) into master (d9be04d) will decrease coverage by 0.04%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master      #86      +/-   ##
==========================================
- Coverage   86.02%   85.98%   -0.05%
==========================================
  Files          34       34
  Lines        2498     2498
  Branches      683      684       +1
==========================================
- Hits         2149     2148       -1
- Misses        315      316       +1
  Partials       34       34

Impacted Files
Coverage Δ

packages/gateway-common-http/src/index.ts
83.63% <100.00%> (ø)

packages/cli-plugin-dev/src/index.ts
81.97% <0.00%> (-0.59%)
:arrow_down:

Continue to review full report at Codecov.

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


Sql DacPac deploy task doesnot log stderr to Build/Release log

Moving https://github.com/Microsoft/vsts-tasks/issues/3002 here
Quoting issue
When using the DacPac Deploy Task, I can see what looks like stdout in the build/release log. However, if the dacpac deployment fails, the stderr output does not appear in the build/release log. I do see:
Initializing deployment (Start)
Initializing deployment (Failed)

##[error]
ErrorRecord : *** Could not deploy package.

However, running the same command in a console gives the actual error (like incorrect SQL version or whatever). It would be great if the stderr was put onto the build/release logs so that we can see error details.

This fix will be released soon. Until then there is a mitigation available.
You can add a Build/Release variable with name System.Debug and value true. This will ouput verbose logs which contain the full error message

Fix will be available in the next release. Meanwhile, please use the work around mentioned above.

Was this released already?

@rloliveirajr yes, it was released. Are you still facing the issue? Can you provide your extension and task version?
@Ajay-MS can you share the extension release version containing this fix? I was not able to find the release branch.

@KrishnaAdityaB do we need to update existed task?

This issue was fixed in extension version 1.3.0.

After talk with Ajay-MS, as we meet this issue in VSTS-TASK not in extension. VSTS team still working on this issue. And it will be available on next 1-2 weeks.

With extension SQL server dacpac deployment task issue has been fixed with version 1.3.0.  This issue is with SQL Azure Dacpac deployment task that will be fixed soon.

fix will be available with next deployment

when is the next deployment?
Thanks,
Nickey

From: Chaitanya Shrikhande<EMAIL_ADDRESS>Sent: Friday, December 30, 2016 2:19:17 PM
To: Microsoft/vsts-rm-extensions
Cc: Nickey Yan; Manual
Subject: Re: [Microsoft/vsts-rm-extensions] Sql DacPac deploy task doesnot log stderr to Build/Release log (#147)
fix will be available with next deployment

You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHubhttps://github.com/Microsoft/vsts-rm-extensions/issues/147#issuecomment-269736746, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AGLat4nWsmmFA6_HitCkI4IsGXIzuE1Eks5rNKJlgaJpZM4K2Z9m.


[Bug]: type existence check return false for the same union type in tcgc

Describe the bug
In JS, we need to generate union as type alias, however, tcgc doesn't provide union types as the references types, therefore, we need to extract the union types from the sdkPackage.models. but I found the same type has been added into emitQueue more than once.

In this case, the type should be the same as what the emitQueue has, but the type existence check returns false.
https://github.com/Azure/cadl-ranch/blob/main/packages/cadl-ranch-specs/http/azure/resource-manager/models/resources/main.tsp#L34-L40
Reproduction
https://github.com/Azure/cadl-ranch/blob/main/packages/cadl-ranch-specs/http/azure/resource-manager/models/resources/main.tsp#L34-L40 It's a cadl-ranch test case.
Checklist

[x] Follow our Code of Conduct
[x] Check that this issue is about the Azure libraries for typespec. For bug in the typespec language or core libraries file it in the TypeSpec repo
[x] Check that there isn't already an issue that request the same bug to avoid creating a duplicate.
[x] The provided reproduction is a minimal reproducible example of the bug.

Proposal:

Treat SdkUnionType as referenced type and cache them in TCGC context when doing typing conversion
Add unions in SdkPackage to expose all the unions

cc: @iscai-msft for thoughts.


Add Gaussian Mixture Model and example

Hi,
I created a GaussianMixture class, together with its example (the comparison of KMeans and GMM).
Though the GMM is not in your todo list, I thought it may help for this project; anyway EM is very commonly used.
The API is close to the KMeans class. Thanks.

Wow. Thanks.


FHG-5727: Manage - small updates off the back of content audit

This is the first round of updates being done as the result of a content audit done in July 2024.
Context
Changes needed to wording and style as result of content audit.
Changes proposed in this pull request
n/a
Link to Jira ticket
See tickets with links to prototypes etc.: https://dfedigital.atlassian.net/browse/FHG-5718?atlOrigin=eyJpIjoiMTI0NzVkNDBkZjY3NGI3YThmNWI0MjY3YzkwYjI0YTEiLCJwIjoiaiJ9

Re-raised in mono repo: https://github.com/DFE-Digital/fh-services/pull/40


Expires Header

Would it make sense to add an expires header (1 year?) to prevent the 304 Not Modified calls? Just a minor performance improvement in general, but for many assets this could be worth it, since the browser saves a whole round trip for each asset (especially on mobile).
Looking for "200 OK (from cache)" instead of "304 Not Modified" to see in the developer tools.

Hi @enspandi. Which files are you thinking this would be for? Also, it's not really an issue for ember-cli-deploy. I assume it's the ember-deploy-redis or ember-deploy-s3 plugins you're talking about.
In which case, the issue should really be raised on the respective repo.

Closing in favor of https://github.com/LevelbossMike/ember-deploy-s3/issues/7


[Snyk] Upgrade react-native-safe-area-context from 4.2.5 to 4.5.0

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

The recommended version is 8 versions ahead of your current version.
The recommended version was released 2 months ago, on 2023-01-19.

Release notes

Package name: react-native-safe-area-context

4.5.0 - 2023-01-194.5.0 (2023-01-19)
Bug Fixes

test: _NativeSafeAreaContext.default.getConstants is not a function (#335) (d424f12), closes #290 #255

4.4.1 - 2022-09-284.4.1 (2022-09-28)
Bug Fixes

don't set codegen configs for older rn cli versions (c4a3ad1)

4.4.0 - 2022-09-284.4.0 (2022-09-28)
Features

support RN 0.70 new arch (#312) (cecdd61)

4.3.4 - 2022-09-194.3.4 (2022-09-19)
Bug Fixes

RCT_NEW_ARCH_ENABLED=0 to disable new arch (#307) (0d74927)

4.3.3 - 2022-08-194.3.3 (2022-08-19)

4.3.2 - 2022-08-194.3.2

4.3.1 - 2022-06-064.3.1

4.3.0 - 2022-06-054.3.0

4.2.5 - 2022-04-264.2.5

    from react-native-safe-area-context GitHub release notes

Commit messages

Package name: react-native-safe-area-context

60312b0 chore: update fabric example to 0.71
910e79e chore: update dependencies
0e96c33 chore: add clang format script
d424f12 fix(test): _NativeSafeAreaContext.default.getConstants is not a function (#335)
fd4c27c Update default kotlin version (#339)
a403ff3 Fix `Could not locate shadow view` errors (#340)
3402b4a Fix gradle dependencies (#343)
8f93c44 chore: release 4.4.1
c4a3ad1 fix: don't set codegen configs for older rn cli versions
1920588 chore: release 4.4.0
cecdd61 feat: support RN 0.70 new arch (#312)
fa24e47 chore: release 4.3.4
0d74927 fix: RCT_NEW_ARCH_ENABLED=0 to disable new arch (#307)
13d542b chore: regen lockfile
c109661 chore: update deps
f27ffe2 chore: release 4.3.3
7cda18f chore: add publishConfig
a230eb5 chore: remove precommit
517b2ef chore: add release-it and conventional commit hook
6cd61d2 Add note about fabric support
d767e09 4.3.2
2bd388b Use useWindowDimensions from react-native
f7a0857 React Native 0.69.x Compatibility (#305)
88ee3d3 Add required architecture only check (#302)

Compare

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

Codecov Report
Patch and project coverage have no change.

Comparison is base (da4acb3) 100.00% compared to head (be04eb7) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #19   +/-   ##
=========================================
  Coverage   100.00%   100.00%
=========================================
  Files            1         1
  Lines          177       177
  Branches        39        39
=========================================
  Hits           177       177

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

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


Firefox opening selection problem

When clicking on the box in order to open the selection,  in Firefox (version 36.0.1) when you just drag a little, the whole text till the end of the page is selected (which is confusing for users).
This doesn't seems to be happening in other browsers.
Tried it with the basic select2 examples.

We need to add -ms and -moz prefixes for user-select in the CSS for single selects.

Duplicate of https://github.com/select2/select2/issues/3216.


CETS Data Sheets

Provide CELTS with the data they have asked for.
Short term: provide a way for CELTS to download a spreadsheet/csv that has all the requested data.
Long term: provide a data page in the CELTS application that the CELTS Admin, and possibly Stu Staff, are able to navigate to that will have displays of the data they have asked for while also providing a way for them to download spreadsheets of the data.

 CETS Data Sheets #857


Update install package instructions.

From this comment

@Rick-Anderson @tdykstra This PR removed the install instructions from the Microsoft.AspNetCore.OpenApi package from the documentation. It's an important part of the setup. Can we revert this change?

@captainsafia  we don't add these instructions to anything but onboarding tutorials.
Per the style guide, we don't have two different approaches to install the package. As it was, it wasn't clear you had to chose one approach.
I'd prefer to remove these instructions and just have:
Install the Microsoft.AspNetCore.OpenApi package.
But we can keep these if you like.

Internal previews

📄 File
🔗 Preview link

aspnetcore/fundamentals/minimal-apis/aspnetcore-openapi.md
Get started with Microsoft.AspNetCore.OpenApi

Install the Microsoft.AspNetCore.OpenApi package.
But we can keep these if you like.

I'm fine with this as long as it is clear that the package needs to be installed in order for the user to leverage any of the APIs referenced here. I was following the pattern used in the NSwag and Swashbuckle guides with this.

Install the Microsoft.AspNetCore.OpenApi package.
But we can keep these if you like.

I'm fine with this as long as it is clear that the package needs to be installed in order for the user to leverage any of the APIs referenced here. I was following the pattern used in the NSwag and Swashbuckle guides with this.

We'll keep these abbreviated tabbed installation instructions.


Speed issue of label

Speed of marquee label in cell increases as much times I reload the tableview .

@Ashish12425 This version of MarqueeLabel is no longer being updated. Please use the combined Swift and Objective-C MarqueeLabel version instead! You may be running into an issue which has already been fixed.
Additionally, that repo contains an example UITableView usage to cross-check against your own implementation (for things like cell reuse).

@cbpowell  Thanks my issue is  resloved


Allow enabling metrics/logging without teardown

By always activating the Prometheus metrics reporter and by using helm upgrade --install, the setup script can be run multiple times
idempotently to enable logging and/or metrics without first tearing down
the existing installation.
Another side-effect of using helm upgrade --install is that we don't actually have to do Helm version discovery in setup.sh anymore.

helm install --upgrade in the PR description was a typo, I'll fix it.
I used the same memory configs we used to use for the demo components built into the chart; of course there are situations and levels of usage that could require a user to increase these values but I never actually hit that when working with the demo components with these limits. I think starting low (but stable with 1 or 2 jobs) is a perfectly fine place to start, and if we start seeing instability, perhaps as the E/K charts update (we don't pin a version), we can increase them.
I can do a little bit of commit reorg, but I don't think I would make the upgrade --install and values file changes separate as that would reduce the "atomicity" of the commit. The reason for the whole change is those two things together and it's clear from the commit message what's going on.

I split the first commit into:
commit 4c0b0e21d61d184f5a7a8f466b628f9358fb5f23

    Minor chart values optimizations

    - Allow Elasticsearch to run as a non-privileged container by disabling
      its requirement for sysctl vm.max_map_count >= 262144
    - Specify an (unused) admin password for Grafana so that it does not
      regenerate its Kubernetes Secret on every upgrade which causes a
      needless restart

commit 35565726f028710ad993da1964d6217121e94f50

    Minor shell optimizations

    Remove a function param to make calls a bit more explicit and remove
    some code duplication.

commit ea5a4019102831c9795a140e333204b30e035f56

    Allow enabling metrics/logging without teardown

    By always activating the Prometheus metrics reporter and by using `helm
    install --upgrade`, the setup script can be run multiple times
    idempotently to enable logging and/or metrics without first tearing down
    the existing installation.


Chart events are not firing when using brokers websocket api

Question
I am using Zerodha kiteconnect to receive the live ticks from websocket. I am receiving the ticks but chart events are not firing. I have gone through your asyncio events and tried it but either I get events fired or ticks. I am really stuck and tried every way but did not find the solution. I need your suggetion and help. It has connect() method which runs infinite loop on main thread. Nothing after it will run. so we have to use the pre-defined callbacks to manage the subscription.
Ref: https://github.com/zerodha/pykiteconnect/tree/master#websocket-usage
Here is a sample code without asyncio:
Code example
from lightweight_charts import Chart
from apimaster import Ticker

def on_search(chart, searched_string):
  chart.topbar['symbol'].set(searched_string)

def on_timeframe_selection(chart):
  print(chart.topbar['symbol'].value, chart.topbar['timeframe'].value)

def on_ticks(ws, ticks):
  # Callback to receive ticks.
  for tick in ticks:
    print(tick)
  # while chart.is_alive:
    print("connected")

def on_connect(ws, response):
  # Callback on successful connect.
  # Subscribe to a list of instrument_tokens (RELIANCE and ACC here).
  ws.subscribe([738561, 5633])

  # Set RELIANCE to tick in `full` mode.
  ws.set_mode(ws.MODE_FULL, [738561])

def on_close(ws, code, reason):
  # On connection close stop the main loop
  # Reconnection will not happen after executing `ws.stop()`
  ws.stop()

if __name__ == '__main__':
  kws = Ticker.ticker()
  chart = Chart(toolbox=True, debug=True)
  chart.legend(True)
  chart.events.search += on_search
  chart.topbar.textbox('symbol', 'n/a')
  chart.topbar.switcher(
      'timeframe',
      ('1m', '5m', '30m', '1d', '1wk'),
      default='5m',
      func=on_timeframe_selection
  )
  # Assign the callbacks.
  kws.on_ticks = on_ticks
  kws.on_connect = on_connect
  kws.on_close = on_close
  chart.show()
  # Infinite loop on the main thread. Nothing after this will run.
  # You have to use the pre-defined callbacks to manage subscriptions.
  kws.connect()

Hey @mtech2008,
The only simple option I can see is to run kws.connect and chart.show in separate threads/processes and make sure your code is thread-safe.
Ideally you would want an implementation of the kws object which uses asyncio, so both show and connect could be run in parallel.
Louis

I am receiving in the following error
run_forever
raise RuntimeError('This event loop is already running')
RuntimeError: This event loop is already running
async def main():
    kite = Zerodha()
    kite.set_session_token()
    print(kite.profile())
    kws = kite.ticker()
    kws.on_connect = on_connect
    kws.on_ticks = on_ticks
    chart = Chart()
    chart.events.new_bar += on_new_bar
    chart.topbar.switcher('timeframe', ('1min', '5min'), func=on_timeframe_selection)
    df = pd.read_csv('ohlc.csv')
    chart.set(df)
    await asyncio.gather(chart.show_async(block=True), kws.connect_ws())

if __name__ == '__main__':
    asyncio.run(main())

Is is with async implementation of Ticker  by https://github.com/ranjanrak/async-ticker

There's a slight issue with their implementation; you'll need to create a child class of MainTicker, and overwrite the connect_ws method:
async def connect_ws(self):
        """
        Establish ws connection
        """
        self.factory = TickerClientFactory(self.ws_url)
        self.factory.protocol = TickerClientProtocol

        self.ws = self.factory.ws

        # Register private callback
        self.factory.on_connect = self._on_connect
        self.factory.on_message = self._on_message

        # Run an infinite loop using asyncio
        loop = asyncio.get_event_loop()
        await loop.create_connection(self.factory, "ws.kite.trade", 443, ssl=True)

Should work.
Louis

Thank you so very much for this help. It worked perfectly well. Thank you.


unsigned char vs float

`
std::vector<matrix> training_images;
std::vector         training_labels;
std::vector<matrix> testing_images;
std::vector         testing_labels;
load_mnist_dataset("d:/mnist", training_images, training_labels, testing_images, testing_labels);
std::vector<matrix<float>> training_images_f;

training_images_f.reserve(60000);

for (const auto& ti : training_images)
{
	matrix<float> ti_f;
	ti_f.set_size(ti.nr(), ti.nc());

	for (int r = 0; r < ti.nr(); ++r)
	{
		for (int c = 0; c < ti.nc(); ++c)
		{
			ti_f(r, c) = ti(r, c);
		}
	}

	training_images_f.push_back(ti_f);
}

using net_type = loss_multiclass_log<
	fc<10,
	relu<fc<84,
	relu<fc<120,
	max_pool<2, 2, 2, 2, relu<con<16, 5, 5, 1, 1,
	max_pool<2, 2, 2, 2, relu<con<6, 5, 5, 1, 1,
	input<matrix<float>>
	>>>>>>>>>>>>;

net_type net;
dnn_trainer<net_type> trainer(net);
trainer.set_learning_rate(0.01);
trainer.set_min_learning_rate(0.00001);
trainer.set_mini_batch_size(128);
trainer.be_verbose();
trainer.set_synchronization_file("mnist_sync", std::chrono::seconds(20));
trainer.train(training_images_f, training_labels);

std::vector<unsigned long> predicted_labels = net(training_images_f);
int num_right = 0;
int num_wrong = 0;
// And then let's see if it classified them correctly.
for (size_t i = 0; i < training_images.size(); ++i)
{
	if (predicted_labels[i] == training_labels[i])
		++num_right;
	else
		++num_wrong;

}
cout << "training num_right: " << num_right << endl;
cout << "training num_wrong: " << num_wrong << endl;
cout << "training accuracy:  " << num_right / (double)(num_right + num_wrong) << endl;
`

Expected Behavior
This code fragment is an essential of an Deep Learning Introduction Part 1 example, except for it uses training_images_f vector of float matrices as an input. Input values are in range of [0.0;255.0] and copied from original training data. Expected to get similar training results as in original example.
Current Behavior
Loss value stops decreasing after just a few epochs. Training accuracy is below 12%.
Steps to Reproduce
Use float matrix with values in range [0.0;255.0] as an input data. If data values are converted to range of [0.0;1.0] traiing results become similar to original example. Are float and char values treated differently or some internal conversion is performed?

Version: 19.16.99 built with Cuda 10.0 support
Where did you get dlib: https://github.com/davisking/dlib/
Platform: Windows 10 64 bit
Compiler: Visual Studio 2017(15.9.3)

Yes, this is what it does.  This is discussed in the documentation: http://dlib.net/dlib/dnn/input_abstract.h.html#input

Also, http://dlib.net/faq.html#Whereisthedocumentationforobjectfunction

Thanks, your documentation is pretty complete, but it's style is not yet too familiar for me. In this particular case, I was confused because "unsigned char" looks like an standard numeric type, which values are should be used "as is, without conversion". You have, for example, rgb_pixel type, which is much more understandable to be converted. Why not to define a kind of "gray_pixel" type to use in such cases?

It will be differ just as rgb_pixel differs from unsigned char[3]. It maybe the same at low-level, but may represent other kind of data. Since your library is not intended to be used only for images, unsigned chars may also represent text chars or even some raw numbers, which are not have to be divided by 256 before usage. However, it maybe just my way of thinking, or I just missing some common convention :)

I think the current setup is what most people expect.
But you can make a new input layer easily that behaves any way you like.

Well, thanks anyway. You're making a great job.


iOS 8 bubble size issue - deprecation

Hi, splendid source, thank you! I am having problems to create size of the bubbles with iOS 8 deprecation:
    size = [self.textLabel.text sizeWithFont:self.textLabel.font       constrainedToSize:CGSizeMake(self.frame.size.width - minInset - STBubbleWidthOffset, CGFLOAT_MAX) lineBreakMode:NSLineBreakByWordWrapping];

Instead, they're suggesting to use:
    NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
    paragraphStyle.lineBreakMode = NSLineBreakByWordWrapping;

    CGRect textRect2 = [self.textLabel.text boundingRectWithSize:CGSizeMake(self.frame.size.width - minInset - STBubbleWidthOffset, CGFLOAT_MAX) options: NSStringDrawingUsesLineFragmentOrigin attributes:@{NSParagraphStyleAttributeName: paragraphStyle.copy} context:nil];
    size = textRect2.size;
    NSLog(@"textRect size 2: %f, %f", size.width, size.height);

Which kinda works, but not always. In one line text sometimes correct, sometimes not. In multi line sometimes correct, sometimes not. If you do a lot of text, it shows only first 3 lines....
I tried to fiddle with the formula, but no luck. Can you please suggest the correct way? The old build for iOS 5 works perfectly!
Thank you
Alex

Sorry for the late reply. I figured it's no use to support anything lower than iOS 7 now so I've changed the deployment target to iOS 7 and replaced the deprecated methods with your implementation. Thanks!

Hi SkyTrix can you please help with this to edit and select multiple bubbles.