Update lerna to use latest ver

lerna decided to restore their old license (MIT)

Pull Request Test Coverage Report for Build 567

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

Totals

Change from base Build 559:
0.0%

Covered Lines:
2833

Relevant Lines:
3521

💛  - Coveralls


SetGraphicsRootDescriptorTable calls do not happen when using dynamic offsets with a buffer descriptor

GFX version: 0.5.0, dx backend 0.5.0
OS: Windows 10
GPU: NVIDIA Quadro M1200

I have a DescriptorType::Buffer of BufferDescriptorType::Uniform, with the format BufferDescriptorFormat::Structured. When I set dynamic_offsets to true, and supply a dynamic offset, nothing is rendered. I checked it out in renderdoc:
Without dynamic offsets:

With dynamic offsets:

It looks like the SetGraphicsRootDescriptorTable never gets called when using dynamic offsets. Looked in the code and found the loop where this (doesn't) happen: https://github.com/gfx-rs/gfx/blob/015fa95b171e1a708e467c47fe843ea1c5f6cc3b/src/backend/dx12/src/command.rs#L821
Also tested on Metal and Vulkan, both seem to work and render the image properly.
I'm willing to work on a fix if somebody could point me in the right direction - I don't know a lot about the d3d12 API but it seems like table_update should be called in addition to descriptor_cbv_update.

I believe I have figured out the root of the issue, working on a PR now.


Find a dataset of meals with their corresponding ingredients

https://www.kaggle.com/datasets/pes12017000148/food-ingredients-and-recipe-dataset-with-images

https://data.world/datasets/meals

2 million recipes dataset
https://recipenlg.cs.put.poznan.pl/dataset


OpenUI5 Github repo doesn't contain patch-level tags for 1.48 release

OpenUI5 version: 1.48
Browser/version (+device/version): N/A
Any other tested browsers/devices(OK/FAIL):
URL (minimal example if possible): N/A
User/password (if required and possible - do not post any confidential information here):
Steps to reproduce the problem:
What is the expected result? The OpenUI5 github repo doesn't contain patch-level tags for the 1.48 release, other than 1.48.0. For other releases, we have tags such as 1.46.8 and 1.46.12. Will there be patch-level tags for 1.48.x? Does the rel-1.48 branch currently exclusively represent 1.48.5 or does it contain additional commits that will make up 1.48.6?
What happens instead?
Any other information? (attach screenshot if possible)

Thank you for reporting this, as far as i can see there are no git tags for the 1.48.x patches starting 1.48.1.
I have created an internal ticket (#1770310864) and informed the infrastructure colleagues to take a look, they will follow up here directly.
Kind Regards,
Michael

Thank you for reporting this issue, as discussed 1.48.5 and 1.48.6 tags are now visible, the other missing tags will be added during the day.
Kind Regards,
Michael


The search bar lowers down for no clear reason

I am a full-stack web developer looking for open-source projects to contribute to. I was looking into making a minor CSS edit to improve the responsibility of the header.
The Issue
When I resize the window by shortening it to 747 or lower in length, the search bar will drop down.

Attempting to look for solution
I noticed that the search element has the following HTML
<input type="search" class="form-control" name="search" id="search" size="30" value="" placeholder="Search">
I searched for the class "form-control" in ranetto.css for options but could not find that class. Am I looking in the wrong place to help with this issue?

Hello 👋
You're in the right place.
The ".form-control" styles are probably coming from another, non-Raneto, CSS file.
It's probably from Bootstrap.
Because Raneto's CSS loads after Bootstraps, you can override it.
"form-control" does not exist yet, so you'll need to add it and you'll be off and running.
.form-control {
  /* Custom CSS Here */
}

However, because form-control is shared with many different elements, try to be specific on the id if you just want to affect the search bar and only the search bar.
There might be rules already for #search in Raneto's CSS
So things would look more like
#search {
  /* Custom CSS Here */
}

Hope that helps!

I have a solution but I cannot seem to get this bar centered when it collapses to a single column.

I am using
css @media only screen and (max-width: 470px) {   #search-and-login {     align-items:baseline;   } }


deprecate jaeger exporter and document otlp

Version(s):

Issue:

Link to docs preview:

QE review:

[ ] QE has approved this change.

Additional information:

Cherry-picked into https://github.com/openshift/openshift-docs/pull/66815

Cherry-picked as https://github.com/openshift/openshift-docs/pull/66815/commits/d6fd8ca3c931e0d317cb638579376032f5c850a7.


Mouse Wheel Intertia/Momentum

Check that this is really a bug

[X] I confirm

Reproduction link
https://swiperjs.com/demos#mousewheel-control
Bug description
When scrolling, no matter how quickly or much you scroll it will only ever do one slide at a time.
Expected Behavior
Scroll an amount (or number of slides) proportional to the amount of scrolling/speed that you did.
Actual Behavior
Only scrolls a slide at a time (waiting for the transition), in free mode it's not smooth at all.
Swiper version
8.3.1
Platform/Target and Browser Versions
Windows 11 Chrome 104.0.5112.102 (and all other browsers..)
Validations

[X] Follow our Code of Conduct
[X] Read the docs.
[X] Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
[X] Make sure this is a Swiper issue and not a framework-specific issue

Would you like to open a PR for this bug?

[ ] I'm willing to open a PR

Issue is closed because of outdated/irrelevant/not actual/needed more information/inactivity.
If this issue is still actual and reproducible for latest version of Swiper, please create new issue and fill the issue template correctly:

Clearly describe the issue including steps to reproduce when it is a bug.
Make sure you fill in the earliest version that you know has the issue.
Provide live link or JSFiddle/Codepen or website with issue


detect provider from url

I have been working on some regex statements for detecting YouTube URLs.  Your directive could really use this to detect the host before displaying it.

Ya, paste me the regex please :+1:

Its not perfect it doesnt handle playlists and certain obscure urls but works for a good majority of cases.
Id be happy to work with you on some for the rest of the providers.  Since I would include them in my project anyways. :)
here 'tis brobeans:
/(?:https?://|www.|m.|^)youtu(?:be.com/watch?(?:.?&(?:amp;)?)?v=|.be/)([\w-]+)(?:&(?:amp;)?[\w?=])?/g

Really thanks, if you want do a pull request I'm glad to pull and update the project. Meanwhile I'll implement and refactor for a new version of ng-video-preview :)


Can we disable neon for osx-arm64 platforms?

Neon acceleration is currently quite slow on osx-arm64 platforms (see https://github.com/FFTW/fftw3/issues/129).
For example, if I compile fftw with --enable-neon it takes 98.8(8) µs per loop to compute a 256x256x256 fftn, compared with 28.7(4) µs without --enable-neon.
I am not sure exactly what neon is for (is it something for iOS?), but it would be good if a faster version could be provided.  (I am new to conda-forge, so don't know how this would be specified.)
Here is the file I used to profile (must be run with ipython):
# perf.py
import numpy as np
import pyfftw

from IPython import get_ipython

ipython = get_ipython()

N = 256
rng = np.random.default_rng(seed=2)
A = rng.normal(size=(2, N, N, N)).view(dtype=complex)

At = np.fft.fftn(A)

At1 = pyfftw.interfaces.numpy_fft.fftn(A)
assert np.allclose(At1, At)

# By default, pyfftw does not cache the plans.  Here we enable the cache
# and set the keepalive time to an hour.
pyfftw.interfaces.cache.enable()
pyfftw.interfaces.cache.set_keepalive_time(60 * 60)

_fftn = pyfftw.builders.fftn(
    a=A.copy(),
    planner_effort="FFTW_MEASURE",
    threads=8,
    overwrite_input=False,
    auto_align_input=True,
    auto_contiguous=True,
    avoid_copy=False,
)

At2 = _fftn(A)
assert np.allclose(At2, At)

# Also, the number of threads is set by default to 1.  Here we set the
# default value to 8 and use FFT_MEASURE to actually check.

ipython.run_line_magic("timeit", "np.fft.fftn(A)")
ipython.run_line_magic("timeit", "pyfftw.interfaces.numpy_fft.fftn(A)")
ipython.run_line_magic("timeit", "_fftn(A)")

I am building fftw with the following commands:
MY_FLAGS="--enable-threads --enable-neon --enable-armv8-cntvct-el0 --prefix=$(grealpath ~/fftw)"
MY_FLAGS="--enable-threads --enable-armv8-cntvct-el0 --prefix=$(grealpath ~/fftw)"
make clean
./configure --enable-float $MY_FLAGS
make
make install
make clean
./configure $MY_FLAGS
make
make install
make clean

Once this is built, I create a conda env and copy the libraries. See also https://github.com/andrej5elin/howto_fftw_apple_silicon
conda create -y -p envs/py3.11 "python~=3.11" ipython
conda activate envs/py3.11
cp ~/fftw/bin/fftw-wisdom* envs/py3.11/bin/
cp ~/fftw/include/fftw3* envs/py3.11/include/
cp ~/fftw/lib/libfftw3* envs/py3.11/lib/
cp ~/fftw/lib/pkgconfig/fftw3* envs/py3.11/lib/pkgconfig/
CFLAGS="-Wno-implicit-function-declaration" pip --no-cache-dir install pyfftw

I then run
ipython perf.py

which gives
# Without --enable-neon
587 ms ± 4.07 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
579 ms ± 6.38 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
29.9 ms ± 1.14 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)

# With --enable-neon
597 ms ± 6.48 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
568 ms ± 7.53 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
98.8 ms ± 759 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)

This is comparable to what I get if I just do
$ conda create -y -p envs/py3.11 -c conda-forge "python~=3.11" ipython pyfftw
...
$ envs/py3.11/bin/ipython perf.py
599 ms ± 7.56 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
550 ms ± 4.44 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
92.5 ms ± 750 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)

For comparison, installing with rosetta (CONDA_SUBDIR=osx-64) gives the following timings:
$ CONDA_SUBDIR=osx-64 conda create -y -p envs/py3.11 -c conda-forge "python~=3.11" ipython pyfftw
...
$ envs/py3.11/bin/ipython perf.py
1.34 s ± 12.5 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
1.29 s ± 205 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
25.9 ms ± 468 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)

I am not sure why running under Rosetta is better.  Am I missing some ARM optimizations?
This is running on a Macbook Pro (16-inch, 2021) with an Apple M1 Max processor and 64GB of RAM.

Possibly the Rosetta one uses the x86 build? That one also has no neon (since it is not an ARM build).
Anyway, your request seems completely reasonable to me. I would gladly merge a PR that comments out the --enable-neon options in https://github.com/conda-forge/fftw-feedstock/blob/43dcbd8644bf4f0c6f4027f1a04515962ced638e/recipe/build_fftw.sh#L73-L74
I think that should do the trick.

I submitted a PR that removes --enable-neon, adds the performance counter --enable-armv8-cntvct-el0  (so that FFTW_PATIENT works) and enabled the long-double build.  (I am not sure why that was disabled.)


SNMP query not performed for other MIBs

How can I perform query for other MIBs, except IF-MIB?
I have tried to add them to the snmp-base.yaml but I don't see any results.
The file content that I use is below. Other MIBs are supported and they return values.
devices:
  dpajin_laptop:
    device_ip: <IP_ADDRESS>
    oid: .<IP_ADDRESS>.4.1.8<IP_ADDRESS>
    snmp_comm: public
    user_tags:
      key1: gggggg
      key2: ffffff
trap:
  listen: <IP_ADDRESS>:162
  community: public
  version: ""
  transport: ""
discovery:
  cidrs:
  - <IP_ADDRESS>/26
  debug: false
  ports:
  - 161
  default_communities:
  - public
  default_v3: null
  add_devices: true
  add_mibs: false
  threads: 4
  replace_devices: true
global:
  poll_time_sec: 60
  drop_if_outside_poll: false
  mib_profile_dir: /etc/profiles
  pymib_profile_dir: ""
  mibs_db: /etc/mib.db
  mibs_enabled:
  - IP-MIB
  - HOST-RESOURCES-MIB
  - IF-MIB
  timeout_ms: 3000
  retries: 1

You would want to make sure its supported by the mib_profile: entry. If the mib is present here -- from a file found in  mib_profile_dir you can enable it in the mibs_enabled section.

Usage of mib_profle: is not documented in the wiki. I was looking and the code and I am not sure what should I put there. I have tried with mib_profle: base.yml and mib_profile: generic but the behavior is the same.
However, I don't think this is even necessary as the profile is determined by the sysoid which is configured in oid key. The logs shows that the profile is found with the message Found profile for .<IP_ADDRESS>.4.1.8<IP_ADDRESS>: base.yml :
2021-07-05T07:37:12.346 ktranslate [Info] KTranslate API server running 2 devices
2021-07-05T07:37:12.346 ktranslate [Info] KTranslate Loaded 2 Kentik devices via local file
2021-07-05T07:37:12.346 ktranslate [Info] KTranslate Client SNMP: Running SNMP interface polling, loading config from /snmp-base.yaml
2021-07-05T07:37:12.347 ktranslate [Info] KTranslate Setting timeout to 3s
2021-07-05T07:37:12.347 ktranslate [Info] KTranslate Setting retry to 1
2021-07-05T07:37:12.347 ktranslate [Info] KTranslate Loading db from /etc/mib.db
2021-07-05T07:37:12.349 ktranslate [Info] KTranslate monitorInput 0 Starting
2021-07-05T07:37:12.360 ktranslate [Info] KTranslate Looking at mib profiles in /etc/profiles
2021-07-05T07:37:12.360 ktranslate [Info] KTranslate Recursing into /etc/profiles/kentik_snmp
2021-07-05T07:37:12.360 ktranslate [Info] KTranslate Recursing into /etc/profiles/kentik_snmp/_general
2021-07-05T07:37:12.363 ktranslate [Info] KTranslate Recursing into /etc/profiles/kentik_snmp/apc
2021-07-05T07:37:12.364 ktranslate [Info] KTranslate Recursing into /etc/profiles/kentik_snmp/arista
2021-07-05T07:37:12.365 ktranslate [Info] KTranslate Recursing into /etc/profiles/kentik_snmp/aruba
2021-07-05T07:37:12.365 ktranslate [Info] KTranslate Recursing into /etc/profiles/kentik_snmp/checkpoint
2021-07-05T07:37:12.366 ktranslate [Info] KTranslate Recursing into /etc/profiles/kentik_snmp/cisco
2021-07-05T07:37:12.370 ktranslate [Info] KTranslate Recursing into /etc/profiles/kentik_snmp/fortinet
2021-07-05T07:37:12.371 ktranslate [Info] KTranslate Recursing into /etc/profiles/kentik_snmp/generic
2021-07-05T07:37:12.371 ktranslate [Info] KTranslate Recursing into /etc/profiles/kentik_snmp/isilon
2021-07-05T07:37:12.372 ktranslate [Info] KTranslate Recursing into /etc/profiles/kentik_snmp/juniper
2021-07-05T07:37:12.374 ktranslate [Info] KTranslate Recursing into /etc/profiles/kentik_snmp/meraki
2021-07-05T07:37:12.374 ktranslate [Info] KTranslate Recursing into /etc/profiles/kentik_snmp/netapp
2021-07-05T07:37:12.375 ktranslate [Info] KTranslate Recursing into /etc/profiles/kentik_snmp/netgear
2021-07-05T07:37:12.375 ktranslate [Info] KTranslate Recursing into /etc/profiles/kentik_snmp/palo_alto
2021-07-05T07:37:12.376 ktranslate [Info] KTranslate Now trying to extend profiles
2021-07-05T07:37:12.376 ktranslate [Info] KTranslate Loaded 663 profiles from /etc/profiles
2021-07-05T07:37:12.376 ktranslate [Info] KTranslate Client SNMP: Running SNMP Trap listener on <IP_ADDRESS>:162
2021-07-05T07:37:12.377 ktranslate [Info] KTranslate System running with format json, compression none, max flows: 10000, sample rate 1:1 after 1
2021-07-05T07:37:12.377 ktranslate [Info] KTranslate sendToSinks base Online
2021-07-05T07:37:12.377 ktranslate [Info] KTranslate sendToSink 0 Online
2021-07-05T07:37:12.377 ktranslate [Info] KTranslate do sendToKTranslate Starting
2021-07-05T07:37:12.377 ktranslate [Info] KTranslate Client SNMP: Running SNMP interface polling, loading config from /snmp-base.yaml
2021-07-05T07:37:12.377 ktranslate [Info] KTranslate Setting up HTTP system on <IP_ADDRESS>:8082/chf
2021-07-05T07:37:12.377 ktranslate [Info] KTranslate Setting timeout to 3s
2021-07-05T07:37:12.377 ktranslate [Info] KTranslate Setting retry to 1
2021-07-05T07:37:12.377 ktranslate [Info] KTranslate Client SNMP: Setting up for 1 devices
2021-07-05T07:37:12.377 ktranslate [Info] KTranslate Client SNMP: Running SNMP for  on <IP_ADDRESS> (type=kentik-router)
2021-07-05T07:37:12.377 ktranslate [Info] KTranslate Found profile for .<IP_ADDRESS>.4.1.8<IP_ADDRESS>: base.yml
2021-07-05T07:37:12.377 ktranslate [Info] KTranslate> Running with SNMP v2c
2021-07-05T07:37:12.377 ktranslate [Info] KTranslate> Running with SNMP v2c
2021-07-05T07:37:12.377 ktranslate [Info] KTranslate> Custom device metadata
2021-07-05T07:37:12.377 ktranslate [Info] KTranslate>    -> : <IP_ADDRESS>.<IP_ADDRESS>.0 -> sysDescr
2021-07-05T07:37:12.377 ktranslate [Info] KTranslate>    -> : <IP_ADDRESS>.<IP_ADDRESS>.0 -> sysObjectID
2021-07-05T07:37:12.377 ktranslate [Info] KTranslate>    -> : <IP_ADDRESS>.<IP_ADDRESS>.0 -> sysName
2021-07-05T07:37:12.377 ktranslate [Info] KTranslate> Custom interface metadata
2021-07-05T07:37:12.377 ktranslate [Info] KTranslate>    -> : <IP_ADDRESS>.<IP_ADDRESS>.1.1.1 -> ifName
2021-07-05T07:37:12.377 ktranslate [Info] KTranslate>    -> : <IP_ADDRESS>.<IP_ADDRESS>.1.1.18 -> ifAlias
2021-07-05T07:37:12.377 ktranslate [Info] KTranslate>    -> : <IP_ADDRESS>.<IP_ADDRESS>.1.1.15 -> ifHighSpeed
2021-07-05T07:37:12.377 ktranslate [Info] KTranslate> Adding custom interface metadata oid: <IP_ADDRESS>.<IP_ADDRESS>.1.1.1 -> ifName
2021-07-05T07:37:12.377 ktranslate [Info] KTranslate> Defaulting rate multiplier to 1
2021-07-05T07:37:12.377 ktranslate [Info] KTranslate> Adding interface metric .<IP_ADDRESS>.<IP_ADDRESS>.1.1.12 -> ifHCOutMulticastPkts
2021-07-05T07:37:12.377 ktranslate [Info] KTranslate> Adding interface metric .<IP_ADDRESS>.<IP_ADDRESS>.1.20 -> ifOutErrors
2021-07-05T07:37:12.377 ktranslate [Info] KTranslate> Adding interface metric .<IP_ADDRESS>.<IP_ADDRESS>.1.19 -> ifOutDiscards
2021-07-05T07:37:12.377 ktranslate [Info] KTranslate> Adding interface metric .<IP_ADDRESS>.<IP_ADDRESS>.1.1.13 -> ifHCOutBroadcastPkts
2021-07-05T07:37:12.377 ktranslate [Info] KTranslate> Adding interface metric .<IP_ADDRESS>.<IP_ADDRESS>.1.1.6 -> ifHCInOctets
2021-07-05T07:37:12.377 ktranslate [Info] KTranslate> Adding interface metric .<IP_ADDRESS>.<IP_ADDRESS>.1.1.7 -> ifHCInUcastPkts
2021-07-05T07:37:12.377 ktranslate [Info] KTranslate> Adding interface metric .<IP_ADDRESS>.<IP_ADDRESS>.1.1.8 -> ifHCInMulticastPkts
2021-07-05T07:37:12.377 ktranslate [Info] KTranslate> Adding interface metric .<IP_ADDRESS>.<IP_ADDRESS>.1.1.9 -> ifHCInBroadcastPkts
2021-07-05T07:37:12.377 ktranslate [Info] KTranslate> Adding interface metric .<IP_ADDRESS>.<IP_ADDRESS>.1.1.11 -> ifHCOutUcastPkts
2021-07-05T07:37:12.377 ktranslate [Info] KTranslate> Adding interface metric .<IP_ADDRESS>.<IP_ADDRESS>.1.14 -> ifInErrors
2021-07-05T07:37:12.377 ktranslate [Info] KTranslate> Adding interface metric .<IP_ADDRESS>.<IP_ADDRESS>.1.13 -> ifInDiscards
2021-07-05T07:37:12.377 ktranslate [Info] KTranslate> Adding interface metric .<IP_ADDRESS>.<IP_ADDRESS>.1.7 -> ifAdminStatus
2021-07-05T07:37:12.377 ktranslate [Info] KTranslate> Adding interface metric .<IP_ADDRESS>.<IP_ADDRESS>.1.8 -> ifOperStatus
2021-07-05T07:37:12.377 ktranslate [Info] KTranslate> Adding interface metric .<IP_ADDRESS>.<IP_ADDRESS>.1.1.10 -> ifHCOutOctets
2021-07-05T07:37:12.377 ktranslate [Info] KTranslate> Using custom interface metric set
2021-07-05T07:37:12.377 ktranslate [Info] KTranslate> Adding user tag key1 -> aaaa
2021-07-05T07:37:12.377 ktranslate [Info] KTranslate> Adding user tag key2 -> bbbb

Even when I remove "HOST-RESOURCES-MIB" from the mibs_enabled: and I have only IP-MIB and IF-MIB it still does not work. MIBs that I want ot use are listed in the base.yml which is used as profile for the device.
$ docker-compose exec ktranslate more /etc/profiles/kentik_snmp/generic/base.yml
extends:
  - system-mib.yml
  - if-mib.yml
  - ip-mib.yml
  - tcp-mib.yml
  - udp-mib.yml
  - ospf-mib.yml

sysobjectid: <IP_ADDRESS>.4.*

I also noticed that file snmp-base.yaml has mibs_db: /etc/mib.db, while file snmp.yaml.sample has mibs_db: "" and there is also directory /etc/mibs.db. I have tried with all three variants, but no change in the behavior.

Best way is to add these via a separate yaml file. As you point out, its keyed off of the sysoid value. Take for example this file:
https://github.com/kentik/ktranslate/blob/main/config/profiles/kentik_snmp/cisco/cisco-nexus.yml
It covers this list of oids:
sysobjectid:
  - <IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS>2
  - <IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS>1

And then includes these defined values:
extends:
  - cisco-all-devices.yml
  - system-mib.yml

To write your own, I would recommend specifying a new yaml file. Include it into the docker with with a command like:
docker run -ti --name ktranslate --rm --net=host \
  -v `pwd`/my_custom_profiles:/etc/profiles/my_custom_profiles
  -v `pwd`/snmp-base.yaml:/snmp-base.yaml \
  kentik/ktranslate:v2 \
    -snmp=/snmp-base.yaml \
    -log_level=info \
    -format=json

https://github.com/kentik/ktranslate/blob/main/config/profiles/kentik_snmp/apc/apc_pdu.yml is another good file to look at for examples of how to add new mibs tables.
Lastly, be sure to include any new mibs in the mibs_enabled: section.
mib_profile_dir  is currently only for internal use and not user extensible.

okay, it works for me now, closing the issue


The return value of triangulation function is possibly wrong

In ch13/include/myslam/algorithm.h
/**
 * linear triangulation with SVD
 * @param poses     poses,
 * @param points    points in normalized plane
 * @param pt_world  triangulated point in the world
 * @return true if success
 */
inline bool triangulation(const std::vector<SE3> &poses,
                   const std::vector<Vec3> points, Vec3 &pt_world) {
    MatXX A(2 * poses.size(), 4);
    VecX b(2 * poses.size());
    b.setZero();
    for (size_t i = 0; i < poses.size(); ++i) {
        Mat34 m = poses[i].matrix3x4();
        A.block<1, 4>(2 * i, 0) = points[i][0] * m.row(2) - m.row(0);
        A.block<1, 4>(2 * i + 1, 0) = points[i][1] * m.row(2) - m.row(1);
    }
    auto svd = A.bdcSvd(Eigen::ComputeThinU | Eigen::ComputeThinV);
    pt_world = (svd.matrixV().col(3) / svd.matrixV()(3, 3)).head<3>();

    if (svd.singularValues()[3] / svd.singularValues()[2] < 1e-2) {
        // 解质量不好，放弃
        return true;
    }
    return false;
}

The docs says that this function should return true if success, but in the implementation, true is returned when discarding the solution. Is this a bug or I am understanding it wrongly?

I see that svd.singularValues()[3] / svd.singularValues()[2] < 1e-2 as a test for condition number. My understanding of the code is that if the condition number is below 1e-2, then the solution is considered to be good. But still I have some confusion:

Is the comment here misleading?
Condition number is the ration of its largest singular value to the smallest singular value. The larger the number is, the more the matrix is considered as ill-conditioned. Since the singular values are sorted in decreasing order, svd.singularValues()[3] is the smallest and svd.singularValues()[2] is a middle value. This is more like a reciprocal of condition number and makes no sense to me. Is this a empirical test?

Let me be more precise:
If svd.singularValues()[3] / svd.singularValues()[2] is seen as a reciprocal of condition number, then the solution is considered t be bad when the value is small. If so, the funtion should return false when svd.singularValues()[3] / svd.singularValues()[2] < 1e-2 is false.

Let me be more precise:
If svd.singularValues()[3] / svd.singularValues()[2] is seen as a reciprocal of condition number, then the solution is considered t be bad when the value is small. If so, the funtion should return false when svd.singularValues()[3] / svd.singularValues()[2] < 1e-2.

Have u figured out what is going on here? i'm also confused why the condition should be this.

Feel free to reopen the issue if you need.

The least squares solution is the right singular vector corresponding to the smallest singular value. If the smallest singular value is not much smaller than the penultimate smallest singular value (by two orders of magnitude), the solution is considered to be of bad quality. So I think the code is fine, but the comment is wrong.


If phone goes to sleep, application stops. This makes it hard to use as something that runs without a lot of user interaction, which is sort of the point for drivers.

If phone goes to sleep, application stops.
Need to either:

not stop once phone is sleeping like native map app

google maps or apple maps
unsure if possible?

provide instructions to user for how to turn off sleep entirely

less good option

figure out if there's a way to keep browser active even without user touch?

Maybe possible?

Potential JavaScript library to stop browser on mobile from going to sleep. Their test page seems to work on my iOS device? https://github.com/richtr/NoSleep.js

Fixed with noSleep.js in this commit: https://github.com/JustinGOSSES/spoken-floodplain/commit/8d75d14dcca95e764e6c3febf17e43a918fc45af


Updates documentation

Description

Adds composer configuration to documentation. Fixes #57.
Updates getting started documentation. Fixes #58.
Writes documentation for phel runcommand. Fixes #61.

@jenshaase I've implemented the changes that you suggested. Let me know what else needs changing. It is better to have more eyes on this text since it will be the official documentation.

Deploy the website. Its live now.


fatal: This operation must be run in a work tree

Output of bower -v && npm -v && node -v:
1.7.9
1.3.6
v0.10.36

Additional environment details (proxy, private registry, etc.):
Steps to reproduce the issue:

run bower install magnific-popup#~0.9.9

Describe the results you received:
received error: ECMDERR Failed to execute "git checkout 2ff1692b1b71e13ec8bf043f05abeead461ceb0d", exit code of #128 fatal: This operation must be run in a work tree
Describe the results you expected:
Install the package

I solved this by running unset GIT_DIR from the command line


Add Workflow Tracing extension

Describe the extension you would like to be added:
Tracing Extension
What is the main purpose of the extension:
Allow users to define tracing extension which can help to optimize workflows with tools such as Jaeger and OpenTelemetry

OpenTelemetry Spec: https://github.com/open-telemetry/opentelemetry-specification


Accounts daemon will remove expired keys.

Current coverage is 98.32% (diff: 100%)

Merging #344 into development will increase coverage by <.01%

@@           development       #344   diff @@
=============================================
  Files               38         38
  Lines             2925       2926     +1
  Methods              0          0
  Messages             0          0
  Branches           145        145
=============================================
+ Hits              2876       2877     +1
  Misses              43         43
  Partials             6          6

Powered by Codecov. Last update 6e811bf...c2f3b09


Create floating_instrument to fix note delay effect

This is an weird patch, but it fixes this test case (where the note delay effect ED6 fails because the instrument is wiped for each new row).
Minimal test case:  https://dl.dropboxusercontent.com/u/47853382/AT4RE - Lock Folder XP 3.6crk - test.xm
Full song:  https://dl.dropboxusercontent.com/u/47853382/AT4RE - Lock Folder XP 3.6crk.xm

Thanks for noticing the issue. Interestingly, this module is linked in the README for showcasing non-trivial usage of effects, yet I missed this note delay issue the whole time (xmp 4.0.4 also messed it up).
Not merging this yet, as I believe there is a better solution using xm_trigger_note() instead.
Thanks for the patch & for finding the issue!

Yeah, I was thinking the same. Perhaps instead just having it persist the regular instrument variable, creating a new variable called note_on in the xm_pattern_slot_s struct which does get updated every new row, and checking note_on before sending the main xm_trigger_note() would be cleaner?
It's a bit of a weird thing to fix, so I kinda just dodgied something together that worked.

33b8015e8f607c6ca38ff81042c155a13a77d00a adds a failing test using delay effects in various situations.
If MilkytTracker is correct, then even recent xmp fails to retrigger with ED0.

That's odd. I've always assumed that Milky is correct, since that note meshes so well with the song, and given where the effect is that's the only thing it could be trying to do. Maybe it's just a not-too-common effect and so xmp gets it incorrect?

Oh yes, xmp is buggy. MilkyTracker hits the nail for the .xm test file (I ran FT2 in dosbox myself just to make sure). Our goal is to match what MilkyTracker does.

Pushed a fix in ecbbd32426202c6f76855b1a8538b15b7d0febbd. If you have a better solution, please let me know. Thanks!


Periodic Config Rules

Periodic Config Rules for:

Daily check the SSM agent version on all EC2 instances running in the region.
Daily check KMS CMK keys without automatic rotation enabled

I get what you are saying. I though of that earlier but could not find a way to send evaluation results for multiple instances in a single API call. Could you point me to such an example code?

Hi there,
is this going anywhere ?

@ppratee - Regarding putting multiple evaluation results in a single API call, PutEvaluations accepts a list of evaluations - multiple instances work fine with this since you specify a resourceId for each evaluation. For an example, you can check out https://github.com/awslabs/aws-config-rules/blob/04e3ecef1b6846e969d88fabcfc34a05256d1326/python/ec2_require_ebs_snapshots_for_volumes#L71

No response. Closing


[Feat] Better integration with LSPs

Background
As we know, LSP has also provided good syntax based highlighting, and may conflict with the hard-encoded rules in this extension. I believe it already happened, for example, Typescript. This extension should work like an improvement for LSP, if LSP is working, and work in full-power mode if LSP not enabled.
Proposal

Change the JSON rule to 2 parts, the improvement mode, and full powered mode
Detect if LSP is enabled for current langauge

Enabled: work with improvement mode
Disabled, work with full powered mode

Full powered mode should be a superset of improvement mode, there should be no conflicts
Rebuild the rules that existing but conflict with LSPs

#8 WIP


change route without invoking onRun

I am only using my routes on the initial page load. After that, I'm handling all the animation and page transitions myself. But I wanted update the urls in the browser. For example
@route 'loginSignup',
  template: 'main'
  path: '/login-signup'
  onRun: ->
    if loggedIn()
      this.redirect 'home'
    this.next()

In main.rendered I have a bunch of reactive autoruns taking care of my views. And when the views change, I set the url with this:
@setRoute = (route, options) ->
    slug = Router.path(route, options).substring(1)
    url =  Meteor.absoluteUrl(slug)
    window.history.pushState('','',url)

Whenever I open the app on my iPhone through the local network, I get this error:
Error: Failed to execute 'pushState' on 'History': A history state object with URL 'http://localhost:3000/' cannot be created in a document with origin 'http://chets-mbp.local:3000'.

So I don't thing window.history.pushState is a good idea apparently. Any ideas?
Thanks

I have the same problem:
Just want to redirect user to another domain like "www.google.cn"
Router.go('http://www.google.cn") does not work any more?

Check out Flow Router. Its much more simple. I like it more


Migrate to SvelteKit

Sapper is no longer actively developed and SvelteKit is a much better experience
Migration guide: https://kit.svelte.dev/migrating

This has been done


Add reviewed shopify-to-google taxonomy mappings

cc @ornanatan @ricardotejedorsanz

re https://github.com/Shopify/product-taxonomy/pull/276#issuecomment-2291310549
Thanks! Done.


write tests using hydra-python-agent

Please correct me if I am wrong. To resolve this issue I should add hydra-python-agent as a dependency and test HTTP requests to hydrus using the ApiDoc documentation?

you can start by creating your own repo with requests and hydra-python-agent and try to send requests to your local server.

Sure, I have done that, no problems. Should I proceed with this?

Please correct me if I am wrong. To resolve this issue I should add hydra-python-agent as a dependency and test HTTP requests to hydrus using the ApiDoc documentation?

it depends, are you meaning to write unit tests or integration tests?
For the latter you have to use the Flask app.test_client() then run some requests against it.

The current code has functional tests which make use of app.test_client() here. Are there any other required testing improvements which this issue is trying to address?


Can't log in to report a problem VS2019

In both VS2019 and VS2019 Preview when I try to report a bug I get a "Method not Supported" error and am unable to complete sign in.
The problem I am trying to report is no intellisense for Cocossharp in a project I moved to a different directory.  I have tried using the Nuget package manager to uninstall and reinstall the package, rebooting etc. The original folder works fine.  The project compiles and runs. The path to the reference .dll is correct and it is there.

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

ID: 7254052d-2d37-509e-e6c8-d5674ea775ca
Version Independent ID: a2acc423-07d3-409c-7de1-21dd88e3cdcd
Content: Report a problem - Visual Studio
Content Source: docs/ide/report-a-problem.md
Product: visual-studio-windows
Technology: vs-ide-general
GitHub Login: @seaniyer
Microsoft Alias: seiyer

@Unbeneva, Can you try to report the issue from Visual Studio Installer?  In the Installer, select the feedback icon in the upper-right corner and select Report a Problem.
Sean
Visual Studio Feedback Team

Hi,  I tried it from the installer and I got the same log in dialog.  After logging in to my microsoft account I get this message:
Your sign-in info has expired. Please sign in again. Re-enter your credentials
This is exactly the same as within the IDE.
I can sign into my GitHub account on the IDE, but I can't activate the license because I get the 'mode no supported' error when trying to log into my microsoft account. Any help would be greatly appreciated. I really don't want it to expire soon.
Thanks

@Unbeneva Could you email me directly at anthc att microsoft dott com so i can follow up with the engineering team??

@Unbeneva I am closing this GitHub Issue now, as it's product-related instead of docs-related, and the product engineering team has reached out to follow up via another venue.


Nothing in the logs

Hello there,
this is strange, i am print logs and then when i look at my log files there is nothing there.
	MyLogger.debug('TEST DELETE THIS NOW');
		MyLogger.debug('TEST DELETE THIS NOW');
		MyLogger.debug('TEST DELETE THIS NOW');
		MyLogger.debug('TEST DELETE THIS NOW');
		MyLogger.debug('TEST DELETE THIS NOW');

		File logsExport = await MyLogger.logs.export(
			fileName: 'all-logs',
			exportType: FileType.TXT,
			filter: LogFilter.last24Hours(),
		);

		print(logsExport.path);

Debug will not show up in the exported logs. Use warning or info. Cheers.

Try setup your logLevel in config on 'LogLevel.ALL'.

Ok thank you very much. I will look into that. Cheers!!


Transaction headers are not preserved when using abiCache to import contract ABI offline

Hi,
I am trying to sign a transaction from the cold storage preserving existing transaction headers. The unit test from index.test.js that uses eosjs.transfer works for me, but when I try to use my own contract by bringing it into the ABI cache, the transaction headers in the config do not get applied. Is this the right way to initialize the contract ABI when httpEndpoint is null? Would it be possible to get a unit test for offline signing with existing transaction headers on a custom contract? Thank you!
const offlineSigningConfig = {
keyProvider: [key],
httpEndpoint: null,
transactionHeaders: headers
}
const eos = Eos(offlineSigningConfig);
await eos.fc.abiCache.abi(accountName, JSON.parse(myAbi));
const myContract = await eos.contract(accountName, { signProvider });
const myAction = await myContract.myAction(myData);
// Incorrect transaction headrers in myAction.transaction.transaction
const memo = ''
const testtrx = await eos.transfer('few', 'many', '100.0000 SYS', memo)
// Correct transaction headrers in testtrx.transaction.transaction

transactionHeaders is a little awkward.. Make sure it is a method that looks exactly like this:
transactionHeaders: (expireInSeconds, callback) => {
        callback(null/*error*/, eosTransactionHeader)
      }

Passing in transactionHeaders as a callback did not help. Calling an action on my contract still sets the expiration time relative to when it is called rather than using the provided transactionHeaders. I verified that the transactionHeaders callback is being called for eos.transfer() but not for myContract.myAction().

Remove {signProvider} here, that is not an option on a contract:
const myContract = await eos.contract(accountName, { signProvider });

Not sure what is going on.  I was able to set static headers and they were used in these cases.  Notice the expiration dates are the same.
// just like your case above:
eos.contract('eosio.msig', (err, msig) => {
  msig.unapprove('test', 'test', {actor: 'test', permission: 'active'})
})

eos.transaction('eosio.msig', msig => {
  msig.unapprove('test', 'test', {actor: 'test', permission: 'active'})
})

From https://github.com/eosio/eosjs#offline-or-cold-storage-transaction
Modified to use eos.fc.abiCache.abi ..
> (async function() {
... expireInSeconds = 60 * 60 // 1 hour
...
... eos = Eos(/* {httpEndpoint: 'https://..'} */)
...
... info = await eos.getInfo({})
... chainDate = new Date(info.head_block_time + 'Z')
... expiration = new Date(chainDate.getTime() + expireInSeconds * 1000)
... expiration = expiration.toISOString().split('.')[0]
...
... block = await eos.getBlock(info.last_irreversible_block_num)
...
... transactionHeaders = {
...   expiration,
...   ref_block_num: info.last_irreversible_block_num & 0xFFFF,
...   ref_block_prefix: block.ref_block_prefix
... }
... })()

> transactionHeaders.expiration
'2018-07-22T19:06:12'

> chainId='aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906'
'aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906'
> keyProvider='5...'
> msigAbi = JSON.parse(fs.readFileSync(`docker/contracts/eosio.msig/eosio.msig.abi`))

> (async function() {
...   eos = Eos({httpEndpoint: null, chainId, keyProvider, transactionHeaders})
...   eos.fc.abiCache.abi('eosio.msig', msigAbi)
...   msig = await eos.contract('eosio.msig')
...   msigTr = await msig.unapprove('test', 'test', {actor: 'test', permission: 'active'}, {broadcast: false})
... })()

> msigTr.transaction.transaction.expiration
'2018-07-22T19:06:12'

Thanks for your help, I got it all working.


[SMALLFIX]Replace %include content with real content in Alluxio-on-a-Cluster.md

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Alluxio-Pull-Request-Builder/19247/
Test PASSed.

Merged build finished. Test PASSed.

Merged build finished. Test PASSed.

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Alluxio-Pull-Request-Builder/19299/
Test PASSed.


Older python versions than 3.10

Is there a specific reason for the build drop on older versions than 3.10 on Windows? Most of thoise versions still get supported by Python, and having wheels available for the newest versions only complicates things alot as soon as you're trying to have synthizer as a default dependency (like within audio game frameworks and such). I have to stick with synthizer 0.12 right now, since that's the last version that also offers builds for older python versions and I don't want people who just want to write a quick python program on Python 3.9 or 3.8 or something (because they are used to it or something) to go through all the manual synthizer building steps, nor will I force them to upgrade as long as the python version is officially supported.

Back when this was more active and entirely me as the maintainer Saturdays turned into push a commit and wait to see if it broke on platforms that aren't mine, push a release and check back in on it every 10-15 minutes, etc etc...was taking longer than actually coding the damned thing by an order of magnitude.
I disagree with your reasoning here, but it doesn't hurt to add back 3.9, and given that wx somehow hasn't put up wheels that does make some sense as a thing worth doing.  This is reasonably straightforward save that monitoring the build will take forever, so if you want it sooner than Saturday you'll want to send a PR.
But here's the thing.  Python 3.8 was 2019.  VS 2017 was either late 2017 or early 2018.  You don't have to install cmake or ninja or any of that.  I think it should be reasonable to expect users to upgrade their tools every 3 years, and this issue in essence boils down to you saying that that's not a reasonable expectation.  For now I'm happy to do this, but if this somehow turns into me as the primary contributor again, we'll have to revisit this.  My time is more valuable to me than supporting effectively ancient compilers and python versions.

Back when this was more active and entirely me as the maintainer Saturdays turned into push a commit and wait to see if it broke on platforms that aren't mine, push a release and check back in on it every 10-15 minutes, etc etc...was taking longer than actually coding the damned thing by an order of magnitude.

Understandable. I usually just continue coding and will get informed via mail if my build broke at some point, and my projects usually don't build in under an hour (Bass4Py cython build takes about 1h20 sometimes for 1 build, and i'm monitoring projects which take even longer to build a single docker container and it still does work for them, with much more devs than this project has).

But here's the thing. Python 3.8 was 2019. VS 2017 was either late 2017 or early 2018. You don't have to install cmake or ninja or any of that. I think it should be reasonable to expect users to upgrade their tools every 3 years, and this issue in essence boils down to you saying that that's not a reasonable expectation.

A little bit narrow-minded IMO. I for example do have VS2017 enterprise and am using it still because it still receives support and updates, and I don't have an Enterprise license for newer VS versions, nor do I need newer features right now. I don't feel like installing every single VS community version because every projects requires a different one or someone asks me to do so, everything else is still working. And there might be other valid reasons that I can't think of right now that are totally fine and don't fall into the "well I always update to the latest version as soon as possible" rule of thumb. Developers trying to use synthizer as a tool for their business might be limited on what they are actually allowed to install, they might not even have the option to install a newer version than 2017, 'cause that would require the company to buy a new license which is kinda expensive (that was the situation at my previous employer for quite a while).
And 2017 is just here for demonstration purposes, you might be switching over to the latest compiler again in a year or so, dropping support for older compilers in the process while others can't do that yet, for whatever reason.

For now I'm happy to do this, but if this somehow turns into me as the primary contributor again, we'll have to revisit this. My time is more valuable to me than supporting effectively ancient compilers and python versions.

Well, right now your userbase is quite small. I think your time might become more valuable as soon as alot of people come here to ask you the same question over and over, "why doesn't this build here", "I get that C error, what can I do?" etc etc. You got build configuration for previous python versions here already, adding them in, except waiting for the builds to finish, just takes a few minutes and will probably save you the support time in the long run, at least thats how I see things. You either lose time waiting for builds, or answering support requests. You either change your workflow to not wait for builds, because you can always stash inbetween your current work to fix an error with the latest build, or you don't answer support requests at all and people will just wander off not using your product because of that. Just discussing the possibilities of course.
I just wanted to kick off the discussion again. For now i'm using synthizer 0.12 because i'm developing a lib which supports Python 3.7 onward, and as long as I do that, i'll have to stick with the latest Synthizer version that either supports wheels for those versions or builds out of the box without having to mess around with specific dependencies or prerequisites, or i'll have to make synthizer an optional addition and replace the default component with something more flexible. Its just clear that we're prioritizing LTS support differently, and our workflow probably kinda differs as well ;).

To be clear before I continue I already said yes, send me a PR or wait a week.  Not sure we can go back as far as 3.7 anymore/at all though, I'm not sure I even supported that originally.  If I did then probably it still works.  The following is sort of the "if this was actively maintained" stance but as long as this is in maintenance mode I'm not sure I really care about these points, so if it's just putting some values back in the lists shrug.
This has been 2019 from day one. I haven't bumped that, don't intend to, and also kinda can't.  Unfortunately the C++ side of things moves somewhat fast these days; depending on what comes down the pipeline and what compilers end up supporting it, I could see an upgrade happening in 2 years from now maybe.
Context switching is expensive.  It's hard to work on other things when 15-30 minutes from now or however long it ends up being is going to require me to come back and hit more buttons or fix problems.  Synthizer is 3 libraries and I also have Ammo.
If this gets more popular then there are presumably more contributors, doing things like LTS and whatnot becomes less of my specific problem.
GitHub Actions has parallelism limits.  Appveyor has even worse ones and also charges a ton of money to fix them.  If this did become popular and we did have half-hour CI jobs, then we run up against the build queue.  At the end of the day scaling CI out costs money beyond a certain point.
We aren't discussing enterprise environments, or weren't originally.  If you're in or know someone in an enterprise environment that has those restrictions who also wants to use Synthizer specifically in Python then I'm thrilled to discuss supporting that, and will quote an hourly rate for them.
Saying "well this old version is supported" isn't actually really saying much because most of those old versions are supported in the sense of security patching and really critical bugfixes.  I'm not the only OSS dev who doesn't care about extremely long LTS periods.  When your engine gets more advanced you're going to begin running into this with other dependencies.  Everyone wants/expects you to upgrade, they're just providing a path for those who can't.  If the stance is "everything still officially supported should be supported" you end up in really weird places in general, and as long as I'm not being paid for my time most of my projects aren't going to take that stance.
If you don't want full VS installs you can install the C++ build tools only.
Or put another way: when this is successful/actually gets enough people then your points become more compelling, till then I don't agree with the stance.

Ok, so good news. Somewhere along the way GitHub raised the concurrency limit to 20 jobs.  It used to be much lower, but it does mean this can scale out more than when I originally took them off.  I'm trying to get this in real quick this evening but we'll see--if I did it right the first time it's done, if not I likely will have to push out.

Done.


fixing issue with installer (#884)

This PR fixes syntax error in installer.
Related issues:
https://github.com/MichMich/MagicMirror/issues/884

Could you add an updated Changelog? Thanks!


Get Style Definitions from pygmentize Command

(Original issue 177 created by None on 2007-01-01T16:10:59+00:00)
Seveas send me this code he uses for generating the static css files for pygmentize on ubuntu-nl.org: http://paste.ubuntu-nl.org/44/
Maybe it would be a good idea to add that functionality to the pygmentize command
Reported by blackbird

(Original issue was assigned to gbrandl)
(Original issue 177 last updated on 2008-03-05T19:42:32+00:00)
(Issue automaticaly closed due to status in Bitbucket: resolved)

(Original comment by gbrandl on 2008-03-05T19:42:32+00:00)
Sadly the link is now broken :(

(Original comment by None on 2007-01-01T16:12:08+00:00)
Additionally:
{{{
#!irc
 (if he needs a license on the code: use whatever pygments uses)
}}}


TwoStageRWLock for lists

This pull request is a smaller chunk of PR #199. It implements the new locking mechanism for lists only. See PR #199 for more details.

I am in the process of adding bench marks to dd. When I am done with that I will run them against this, then assuming the is no significant performance hit will merge this PR.

I have added some benchmarks to dd and compared the performance difference between the previous locking mechanism and the changes here. The good news is I see is no significant difference is performance. So let's get this in. First I will add some review notes.

I have added some benchmarks to dd and compared the performance difference between the previous locking mechanism and the changes here. The good news is I see is no significant difference is performance. So let's get this in. First I will add some review notes.

Great! I have addressed your comments in my latest commit. Let me know if there is anything else that needs tweaking.

Thanks. I suggest 2 more PRs. The first to add the new lock to source cache and the second to add Preview to list and cache.
I am sure what you are doing will be a great contribution to this library.


Print clusterIDs instead of cluster name from kubeconfig

whenever possible. So when a cluster is joined with the user-specified clusterID (via --clusterid flag), all subctl commands will print that clusterID and not the clustername from kubeconfig.
Signed-off-by: Janki Chhatbar<EMAIL_ADDRESS>

Do we want to un-draft this and discuss?


Configuring RancherOS to load extra kernel modules does not work

I ran
rancherctl config set modules '[tun]'

to change rancher.yml to:
modules:
- tun

But the tun module was not loaded after rebooting the host.

Once this bug is fixed, can we make the default rancher.yml to include one line to load tun module? Partly to show how module load works, partly to enable KVM and RancherVM by default.


Input in terminal yes/no than if/else

I am trying to input yes on the terminal to confirm or no to skip. I the code always says answer not match. try again..., typed yes/no/bla bla. Always same answer not match. try again...
What I am doing wrong?
     var user_Answer = await readLine();
     await verify_User_answer()

async function verify_User_answer(){
      if (user_Answer == 'yes') {
        console.log(`user_Answer is ${user_Answer}`)
        console.log(`Confirmed, Deleting...`)
       // some command
      } else if (user_Answer == 'no') {
        console.log(`user_Answer is ${user_Answer}`)
        console.log(`Ignoring this task. Moving next`)
      } {
        console.log(`answer not match. try again...`)

        var user_Answer = await readLine();
        console.log(`user_Answer is ${user_Answer}`)
        await verify_User_answer()
      }
    }

    async function readLine() {

    const rl = readline.createInterface({
      input: process.stdin,
      output: process.stdout
    });

    return new Promise(resolve => {

        rl.question('Enter answer yes to delete the task: ', (answer) => {
          rl.close();
          resolve(answer)
        });
        })
    }

The cause is you declare local variable user_Answer  in verify_User_answer() which shadows the global variable and is undefined from the beginning of the function till the assignment. Just replace var user_Answer = await readLine(); with user_Answer = await readLine(); inside verify_User_answer() .
And you also forget the else after the else if block.

Thank You


[Request] Freeze specific connections between layers

There are some new neural networks which need to freeze some specific connections(weights) between layers. For example: PathNet: Evolution Channels Gradient Descent in Super Neural Networks. But I can't find related methods after digging the source code.
Is it possible to implement something like this?
model.freeze_weight(lambda x: np.abs(x) < 1e-3)
I'd like to contribute if possible (because I'm doing some related works).

Any updates?


What's the differents between this and 'Buffer'?

I can also encode/decode strings using Buffer that only dependent on one library "buffer": "^5.2.0"
import {Buffer} from "buffer"
export default class EncodeUtils {
    static encodeBase64Content(content) {
        return new Buffer(content).toString('base64')
    }
    static decodeBase64Content(base64Content) {
        return new Buffer(base64Content, 'base64').toString();
    }
}

base64 of Buffer corresponds to atob and btoa, which differ from .encode and .decode of Base64.
https://github.com/dankogai/js-base64#decode-vs-atob-and-encode-vs-btoa


Streaming Encoder/Decoder

Closes #5. Should work even for no_std targets!

Okay, I'm done with messing with this PR now, let me know if you have any questions!

LGTM. Ideally I think the streaming decoder would allow streaming the output as well, instead of placing the output in a buffer. So with every input byte the decoder would return zero or one output bytes, and the user could consume the output in a streaming manner. But this PR works and is an improvement to the API so I'll merge it.


migrate/push: allow skipping the 'latest' tag

Can you update the doc with a small example? https://github.com/ariga/atlas-action?tab=readme-ov-file#arigaatlas-actionmigratepush

I updated the readme


KAFKA-2944: fix NullPointerException in KafkaConfigStorage

Lost of "config messages" can affect the logic of KafkaConfigStorage;
Call readToEnd after sending each message to KafkaBasedLog to ensure that all config messages are flushed to Kafka;
Since "config messages"  sending to KafkaBasedLog are metadata, it will not affect performance too much;

@ewencp
Does it make sense?

@ewencp
Does it make sense?

@ewencp
~not sure if it is appropriate to raise this pr;
It is great if you can take a look at this and leave some comment  : )

@ZoneMayor Can you explain how this patch should fix the underlying problem reported in KAFKA-2944? It looks like it refactors some code, but I don't understand how it will avoid the NullPointerException?
The bug is definitely transient -- it's timing dependent because it occurs only when shutdown (and therefore stop() calls) occur at just the right time in the middle of a config write, so it will be difficult to create a test for and validate that it no longer occurs.

@ewencp
Hi, thanks a lot for the comment;
KakfaConfigStorage code is like below:
......
else if (record.key().startsWith(TASK_PREFIX)) {
......
synchronized (lock) {
......
Map<ConnectorTaskId, Map<String, String>> deferred = deferredTaskUpdates.get(taskId.connector());
if (deferred == null) {
deferred = new HashMap<>();
deferredTaskUpdates.put(taskId.connector(), deferred);
}
deferred.put(taskId, (Map<String, String>) newTaskConfig);
}
} else if (record.key().startsWith(COMMIT_TASKS_PREFIX)) {
......
Map<ConnectorTaskId, Map<String, String>> deferred = deferredTaskUpdates.get(connectorName);
int newTaskCount = intValue(((Map<String, Object>) value.value()).get("tasks"));
Map<String, Set> updatedConfigIdsByConnector = taskIdsByConnector(deferred);
Set taskIdSet = updatedConfigIdsByConnector.get(connectorName);
if (!completeTaskIdSet(taskIdSet, newTaskCount)) {
inconsistent.add(connectorName);
} else {
if (deferred != null) {
taskConfigs.putAll(deferred);
updatedTasks.addAll(taskConfigs.keySet());
}
inconsistent.remove(connectorName);
}
......
The NullPointerException is because that taskIdSet is null;
If the 'task config' is missed, there will be no (taskId, newTaskConfig) put into deferedTaskUpdates;
Then if the 'commit task config' is not missed, defered as below will be returned as null:
Map<ConnectorTaskId, Map<String, String>> deferred = deferredTaskUpdates.get(connectorName);
With defered as null, the updatedConfigIdsByConnector will be an empty HashMap, thus taskIdSet will be null;
NullPointerException happens if above is correct;
I make a bold assumption that task reconfigure is not always happen, and task config put into configStorage is a kind of 'metadata', so it's worth call a 'blocking send' to ensure the correctness of the logic;
BTW, I really tried hard, but can hardly find the relation between the shutdown and the NullPointerException;
It's great to have your comment again : )

@ewencp
the previous patch doesn't make sense, I modified it;
take a look at the code;
KafkaConsumer will try to do another fetch after every poll, from my understanding, poll(0) will return immediately with any records already available in Fetcher's memory;
If there is chance the message of "task config commit" is consumed twice, logic of consumedCallback in KafkaConfigStorage can be disturbed;

@ewencp
in KafkaConsumer::poll(long timeout), if the timeout is 0, it will return immediately with any records that are already available;
The code is like below:
do {
  records=pollOnce(remaining);
  if(!records.isEmpty) {
    fetcher.initFetches(metadata.fetch());  // fetcher init another request to prefetch data for performance
    client.quickPoll();
    return new ConsumerRecords<>(records);
  }
  long elapsed = time.milliseconds() - start;
  remaining = timeout - elapsed;
} while (remaining>0);

Let's take a look at KafkaConfigStorage
the process is like below:
KafkaConfigStorage::putTaskConfigs(configs) {
  configLog.readToEnd();
  configLog.send()    //send taskConfig;
  configLog.readToEnd();
  configLog.send()   //send taskConfig commit;
  configLog.readToEnd();

Is it possible that the consumer fetcher inits another fetch request just after sending taskConfig commit and before KafkaBasedLog::poll(0)?
If so, the poll(0) inside KafkaBasedLog::readToLogEnd() will return data, which will cause the consumedCallback of KafkaConfigStorage called first time;
And then, consumer of KafkaBasedLog seek back to the start position, and start to consume the taskConfig commit message again;
If the taskConfig commit message again is consumed twice, it will result in NullPointerException;
If above make sense, I think there needs to be more code to tackle the special case;

@ewencp Do you want to take another look?


[SPARK-38996][SQL][3.3] Use double quotes for types in error massages

What changes were proposed in this pull request?
In the PR, I propose to modify the method QueryErrorsBase.toSQLType() to use double quotes for types in error messages.
Why are the changes needed?

To highlight types and make them more visible for users.
To be able to easily parse types from error text.
To be consistent to other outputs of identifiers, sql statement and etc. where Spark uses quotes or ticks.

Does this PR introduce any user-facing change?
Yes, the PR changes user-facing errors.
How was this patch tested?
By running the modified test suites:
$ build/sbt "test:testOnly *QueryParsingErrorsSuite"
$ build/sbt "test:testOnly *QueryCompilationErrorsSuite"
$ build/sbt "test:testOnly *QueryExecutionErrorsSuite"
$ build/sbt "testOnly *CastSuite"
$ build/sbt "testOnly *AnsiCastSuiteWithAnsiModeOn"
$ build/sbt "testOnly *EncoderResolutionSuite"
$ build/sbt "test:testOnly *DatasetSuite"
$ build/sbt "test:testOnly *InsertSuite"

Authored-by: Max Gekk<EMAIL_ADDRESS>Signed-off-by: Max Gekk<EMAIL_ADDRESS>(cherry picked from commit 5e494d3de70c6e46f33addd751a227e6f9d5703f)
Signed-off-by: Max Gekk<EMAIL_ADDRESS>

Back port of https://github.com/apache/spark/pull/36324 right? worth mentioning

Merged to branch-3.3.


🎨 [Design] : Workspace : Proposal Publishing Workflow

[ ] This ticket has some open items, that need to be discussed. Especially the labeling of proposal statusses can be streamlined.

Summary
This is the very basic implementation of proposal management, switching the proposal between draft and published, and private and public.
Description / user story
As an admin, I need the ability to change the status of the proposal I have open in my workspace/proposal editor, so I can control what is visible to end users.
Acceptance Criteria:

[ ] Show "Proposal Management" status in banner: Public Draft, Private Draft & Public Published, Private Published.
[ ] This panel should also show the front-end url, for users to copy. (currently not there)
[ ] When user click proposal management, launch modal
[ ] If user select draft/private+save, the draft proposal is NOT shown to end users, acts as youtube unlisted fuctionality.
[ ] If user select draft/public+save, the draft proposal IS shown to end users.
[ ] If user select published/private, the proposal is shown to end users, acts as youtube unlisted fuctionality.
[ ] If user select published/public, the proposal IS shown to end users.
@mike-mcnulty Feel we need a better handle on this.
Status = Visablity.
Progress = Need a range?
Access = Listed y/n
Url a url that can be copied if things are not appearing in the listing.

AC:

[ ]  If user select published, then proposal visible to end users
[ ] Update proposal status on backend if user makes new selection

Figma design: Basic Proposal management

Have created simple model of proposal states, just need to confirm intent regarding publishing versions etc.


node-red-contrib-amazon-echo has 2 Versions?

hey
I had to reinstall NodeRed and I am adding all the packages I was using.
Now i would install "node-red-contrib-amazon-echo", but i found "node-red-contrib-amazon-echo-oztourer", too.
where are the differences here? Which version should I install now?
Thank you =)

The other is a fork of this one by another user.  Click the "View on github" link on the page you linked and you'll be able to see it's from a different user.


[sparse] Add BCSR from_scipy_sparse.

A constructor that takes scipy sparse matrix as input.

@jakevdp

Let's just consolidate tests, otherwise this looks great!

Thanks! PTAL.


No such image: bigdatauniversity/spark:latest (tag: latest)

I'm trying to download "bigdatauniversity/spark" from Docker- Kitematic-Alpha.
I'm getting below error message:
no such container
404
No such image: bigdatauniversity/spark:latest (tag: latest)

The image you're requesting is quite large ~2GB - I make sure that you're on a solid network before downloading it:
https://hub.docker.com/r/bigdatauniversity/spark/tags/
Does getting it via the command line work? docker pull bigdatauniversity/spark:latest ?

I'm trying to download from Docker Kitematic(Alpha). once its downloaded , then I could use
docker pull bigdatauniversity/spark:latest

Kitematic (GUI)
Start Kitematic in Docker folder
type bigdatauniversity in the search box to filter the Docker Hub catalog to Big Data University provided images
Click on Create button on the spark image to create Docker container using this image.

I understand this - I was wondering if you had the same result when you did it from the command line?

I'm getting a similar error.

Also when I try to search from the command line:
$ docker search elasticsearch
Error response from daemon: Get https://index.docker.io/v1/search?q=elasticsearch: dial tcp: lookup index.docker.io on <IP_ADDRESS>:53: read udp <IP_ADDRESS>:53: i/o timeout

But it seems to work with curl:
$ curl https://index.docker.io/v1/search?q=elasticsearch
{"num_pages": 68, "num_results": 1677, "results": ...

I noticed when I got this error, sometimes you need to click on the elipsis and change which tag to pull (i.e. if latest doesn't exist). Not sure if it will help here though (since the latest tag does exist).

make sure that before you run it in the terminal you issue:
eval $(docker-machine env default)
thanks @mixxmac for the input, it's true that for certain images getting the proper Tag helps.

My problem seems to have fixed itself and running $ docker search elasticsearch now also works...

FrenchBen,
Worked in command line by " docker pull bigdatauniversity/spark:latest". When trying to start Daemon
" docker run -d --hostname bigdatauniversitySpark --name bdu_spark -P -p 8080:8080 -p 8081:8081 bigdatauniversity/spark:latest /etc/bootstrap.sh -d"
Getting below error:
7ff967bf8aee81b2f55fbd0db8e525649dfb70c5cdfd801d680c2d5eb15d33e7
Error response from daemon: Cannot start container 7ff967bf8aee81b2f55fbd0db8e525649dfb70c5cdfd801d680c2d5eb15d33e7: [8] System error: exec: "C:/Program Files/Git/etc/bootstrap.sh": stat C:/Program Files/Git/etc/bootstrap.sh: no such file or directory

Didn't have any issues running it here (osx):
docker run -d --hostname bigdatauniversitySpark --name bdu_spark -P -p 8080:8080 -p 8081:8081 bigdatauniversity/spark:latest /etc/bootstrap.sh -d d413fc81f2073203b2de5c96d4a4ac1fda382a405303ba1e1dec1173a6095138
Do you have some specific shell setup? I don't have a windows machine to try this on unfortunately

docker run -d --hostname bigdatauniversitySpark --name bdu_spark -P -p 8080:8080 -p 8081:8081 bigdatauniversity/spark:latest /etc/bootstrap.sh -d
Error response from daemon: Conflict. The name "bdu_spark" is already in use by container 7ff967bf8aee. You have to delete (or rename) that container to be able to reuse that name.
I dont have specific shell setup. Now I'm getting error response?

error because the previous setup stopped working but isn't removed. You need to stop/remove it first:
docker stop bdu_spark && docker rm bdu_spark


Support dot chaining

This is the proposed new model in EBNF like representation, using the actual parse node names:
ExprNode:
    Term
  | BinaryExpression
  | NewInstance
  | EmptyOfTypeNode
  | CopyWith
  | IfExpr
  | Lambda
  | FunctionRef // to be added when #638 is implemented

Term:
    TermSimple
  | TermChained

BinaryExpression:
  Term BinaryOperation ExprNode // would prefer RHS to be Term, but that caused many failures

TermSimple:
    SymbolNode //note that this is not the same as the current SymbolNode, which is to be renamed to PunctuationNode
  | LiteralValueNode // Must be after symbol so that `true`/``false` do not prompt completion of an identifier starting `n`
  | lmmutableListNode
  | ArrayList node
  | DictionaryNode
  | ImmutableDictionaryNode
  | TupleNode
  | UnaryExpression  // Must be after symbol so that `not` does not prompt completion of an identifier starting `n`
  | BracketedExpression

TermChained:
    TermSimple (DOT symbol)+  // + because must be at least one dot-extension
  | (PROPERTY | GLOBAL | LIBRARY) (DOT symbol )+

SymbolNode:  // Having a single node for symbol should make auto-completions easier to implement
    THIS // sorts out current issues with 'this' (see #707) implemented as KeywordNode to get rendering
  | IdentifierNode IndexNode? // indexNode covers: single-index, double-index, and range
  | MethodCallNode IndexNode? // compiler enforces that method must be a function (or system method if inside a proc)

Passing to Stef. All work on this so far is in branch dotChainProgressively

Several existing parse nodes have been renamed - but all tests are passing

There is a new parallel hierarchy with root ExprNode2 that is eventually to replace ExprNode. ExprNode2 is tested to parse all existing tests for ExprNode and new ones which involve more chaining.

ExprNode2 is dependent on both existing parse nodes and new ones, the latter either intended ultimately to replace existing (e.g. Term2, MethodCall2) or are brand new. Of the latter, many are just implementations of AbstractAlternatives and so have no impact on the AST model. Others that do impact the AST are:

SymbolNode TermChained which are key, and DotBefore DotAfter which are simple.

There is a lot of scope for clean up of other (e.g. of varRefNode varRefCompound procRef and anything else that previously used 'qualifiers' and which should now use the new new constructs - but I think the first stage is to get the new structure for expressions working.


Rule214BlindWriteLocalRecord exception (part 2)

Describe the bug
The CodeCop still breaks in our projects and below is an example of this using the latest AL Language extension and working on a BC 16.2 DK OnPrem project:

Note: if we activate the AppSourceCop in the same project, then the compiler bugs related to the CodeCop goes away - maybe it's a priority in the compiler:

To Reproduce
I cannot provide step-by-step instruction, BUT I can share a private link to a AL Project that has this issue.

thanks

@MarcHansenMicrosoft if you drop me at mail at<EMAIL_ADDRESS>then I will provide a project you can use for the troubleshooting analysis.

Any updates on this issue?
We have so many CodeCop errors in our projects related to app.json and these different kind of "runtime error" in the compiler that we no longer trust the code analysis!
Also I have enclosed another one in attached screenshots incl. how to "resolve" the error - and the fix gives no meaning.....

Hi @kasperdj I've send you an email, please share the project that is triggering this error

@PaulIvan 2 x projects examples provided via a private link

Hi @kasperdj I can see that the rule has indeed been fixed in June.
Please try the latest developer preview https://github.com/microsoft/AL#al-developer-preview-builds

Hi @PaulIvan
It seems like the new AL Compiler you roled out today have solved the problem for this issue.
It also introduced a lot of warnings in my projects due to new code cop rules etc.


Print an informative error message when workflow execution fails due to an error in workflow file syntax

When workflow execution fails due to a syntax error in the workflow file, users should get an error message that helps them understand there is an issue with their workflow file and what the issue is. The user should understand that the workflow file is written incorrectly, where the mistake is located, and how they might fix the mistake.
For example: Right now if I leave out the "method" in a step, i get an error that says Error: Cannot read properties of undefined (reading 'length'). Since the error doesn't help me understand or debug the issue, it is not helpful!
Parent story: https://github.com/polywrap/monorepo/issues/984

Fixed by https://github.com/polywrap/toolchain/pull/1234 and prior PRs formalizing the Workflow manifest syntax


New version: Audius.Audius version 1.5.55

- [X] Have you signed the Contributor License Agreement?

[ ] Have you checked that there aren't other open pull requests for the same manifest update/change?

[X] Does your manifest conform to the 1.5 schema?

Microsoft Reviewers: Open in CodeFlow

/AzurePipelines run


Updating Docs - configuration table, shoutrr, Scrutiny, etc

Summary

removing WATCHTOWER_NOTIFICATIONS as this is legacy notifications. Reference watchtower legacy notifications documentation
adding  Watchtower (shoutrrr) token authentication URL

Note: at this time, this is not updated in shoutrr ntfy documentation but verified that it works

adding logging configurations to to config option table
adding Scrutiny project to integration documentation. Scrutiny is a webUI for smartd S.M.A.R.T monitoring. This includes notifications through shoutrrr.
adding note about caddy. for beginners to caddy they should know they don't need additional configuration for WebSockets as caddy handles this (along with HTTP) with reverse_proxy

Thank you


Git tries wrong branch when branch is named beginning with +

Prerequisites

[x] Put an X between the brackets on this line if you have done all of the following:

Reproduced the problem in Safe Mode: https://flight-manual.atom.io/hacking-atom/sections/debugging/#using-safe-mode
Followed all applicable steps in the debugging guide: https://flight-manual.atom.io/hacking-atom/sections/debugging/
Checked the FAQs on the message board for common solutions: https://discuss.atom.io/c/faq
Checked that your issue isn't already filed: https://github.com/issues?utf8=✓&q=is%3Aissue+user%3Aatom
Checked that there is not already an Atom package that provides the described functionality: https://atom.io/packages

Description
Cannot push in atom, whilst cli pushing works. I suppose the Branch name starting with a Plus symbol is not parsed correctly.
Steps to Reproduce

Create Branch in gitlab
name it +Pages
switch branches in atom and push to the branch

Expected behavior: Atom Pushes to Branch
Actual behavior: Atom throws: error: src refspec Pages does not match any.
error: failed to push some refs to
'https://git.organisation.com/user/project
Reproduces how often: Every time
Version 1.33.0
Additional Information:
CMD ALT I reveals
Uncaught (in promise) GitError: git push origin +Pages in /Users/Admin/Documents/GitHub/project exited with code 1
stdout:
stderr: error: src refspec Pages does not match any.
error: failed to push some refs to 'https://git.company.org/user/project.git'

    at new GitError (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:14:2766914)
    at Promise (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:14:2771732)
    at <anonymous>

/move to atom/github


Spencer Walker

learning how to pull request

Thanks for the tutorial! Very helpful.

Thanks for the tutorial! Very helpful.

Great PR 🐯


WebSockets

Please implement WebSockets feature in honojs.
https://developers.cloudflare.com/workers/runtime-apis/websockets/

Not just cloudflare, but also Node.js and deno

You can use WebSockets with the current version of Hono on Deno.
Refer: https://github.com/orgs/honojs/discussions/755
It can also be supported on Cloudflare Workers.
More info: https://developers.cloudflare.com/workers/learning/using-websockets/
For Node.js, you can't use WebSockets with the current Node.js Adapter and there are no plans to implement it. But, if you want this feature, you might be able to write the PR yourself.

Hi @JustJoostNL !
I've written an example. Try this!
import type { WebSocket as CFWebSocket } from '@cloudflare/workers-types'
import { Hono } from 'hono'
import { html } from 'hono/html'

const app = new Hono()

app.get('/', (c) => {
  return c.html(
    html`

WebSocket

    `
  )
})

app.all('/websocket', async (c) => {
  const upgradeHeader = c.req.header('Upgrade')
  if (upgradeHeader !== 'websocket') {
    return c.text('Expected websocket', 400)
  }

  const webSocketPair = new WebSocketPair()
  const client = webSocketPair[0]
  const server = webSocketPair[1] as unknown as CFWebSocket
  server.accept()
  server.send('Hello')

  return new Response(null, {
    status: 101,
    webSocket: client,
  })
})

export default app

Thanks!

It should be fairly trivial to make universal middleware for Workers, Deno and possibly Node. If I have the time, I could look into it as 3rd party middleware but no promise. Bun seems to be out of the question because of how their API works.
Useful links for reference:
Deno.upgradeWebSocket
Cloudflare
ws package for Node
Bun WebSockets

Yeah, making a "universal" middleware is make sense.

Is there currently any restriction on manually implementing the connection upgrade on the route handler?
I’m wondering how I could implement it with the ws package for node, also wondering about Bun.

You have to "attach" it to the node:https server returned by the serve function in the node adapter, and then use handleUpgrade, it'd definetly require some messing around with internals but it should be possible. As for Bun, you can put the upgrade function into Env from the hono server and in theory use WebSockets normally but the approach is completely different from Deno and Workers

WebSockets example for Node.js
import { serve } from "@hono/node-server";
import { Hono } from "hono";
import { WebSocketServer } from 'ws';

const app = new Hono();

const server = serve(app, (info) => {
    console.log(`Listening on http://localhost:${info.port}`);
});

const wss = new WebSocketServer({ server });

wss.on("connection", function connection(ws) {
    ws.on("error", console.error);

    ws.on("message", function message(data) {
        console.log("received: %s", data);
    });

    ws.send("something");
});

Awesome this is exactly what I needed thank you 🎉

I couldn't find any documentation on the WebSocket server included with Bun. This is how I got it working, but I'm sure there's a better way to handle upgrades.
import { Hono } from 'hono'

const app = new Hono()

Bun.serve({
    fetch: (req, server) => {
        if (server.upgrade(req)) {
            // handle authentication
        }
        return app.fetch(req, server)
    },
    websocket: {
        message(ws, message) {},
        open(ws) {
            ws.send('Hello!')
        },
        close(ws, code, message) {},
        drain(ws) {}
    },
    port: 8080
})

For someone interested in using WebSockets via node server and socket.io check out this snippet
import { serve } from "@hono/node-server";
import { Hono } from "hono";
import type { Server as HTTPSServer } from "node:http";
import { Server as SocketIOServer } from "socket.io";

const app = new Hono();

app.get("/", (c) => c.text("Hello Hono!"));

const server = serve(
  {
    fetch: app.fetch,
    port: 5000,
  },
  (add) => {
    console.log('Listening on http://localhost:'+${add.port});
  }
);

const io = new SocketIOServer();

io.attach(server as HTTPSServer);

io.on("connection", (socket) => {
  socket.emit("hello", "world");
  socket.on("hello", (data) => {
    socket.broadcast.emit("hello", data);
  });
});

A better way to do this in bun is:
const app = new Hono<{Bindings: {
  server: Server
}}>()

app.get("/ws", async (c) => {
  // Auth or validation code
  if (
    !c.env.server.upgrade(
      c.req as any, // the needed info works fine
      {
        data: {
          // any extra data you want to pass through to the websocket handler
        },
      }
    )
  ) {
    return c.text("I failed to upgrade!")
  }
})

Bun.serve({
  port: process.env.PORT || "8080",
  fetch: (req: Request, server: Server) => {
    return app.fetch(req, {
      server,
    })
  },
  websocket: {
    message(ws) {
      console.log("got message", ws.data)
    },
    open(ws) {
      console.log("websocket opened", ws.data)
    },
  },
})

Inspired by the above example but it puts the upgrade logic in hono so you can use middleware and such

I would love to see a simpler way to handle WebSocket upgrade on Bun using a specific route (e.g. /ws) where you can handle events inside that route. For now as i described in this discussion, i was able to upgrade inside a route using the following:
app.get('/ws', (c) => {
  const success = c.env.upgrade(c.req.raw)
  return true
})

Another example how to upgrade all WebSocket upgrade requests using Bun:
Bun.serve({
  port: process.env.PORT || 3000,
  fetch: (req, server) => {
    // check if request is websocket
    if (req.headers.get('upgrade') === 'websocket') {
      const success = server.upgrade(req);
      if (success) {
        // Bun automatically returns a 101 Switching Protocols
        // if the upgrade succeeds
        return undefined;
      }
    }
    // handle HTTP request normally
    return app.fetch(req, server)
  },
  websocket: webSocketHandler,
})

I would love to see a simpler way to handle WebSocket upgrade on Bun using a specific route (e.g. /ws) where you can handle events inside that route. For now as i described in this discussion, i was able to upgrade inside a route using the following:
app.get('/ws', (c) => {
  const success = c.env.upgrade(c.req.raw)
  return true
})

This worked in typescript? That's undefined on c.env for me

This worked in bun with typescript? That's undefined on c.env for me

I'm using JavaScript

I'm using JavaScript. You could try the other method i mentioned (inside the fetch call)

Ah I understand why, for the typescript folks, you can do this:
const app = new Hono<{
  Bindings: {
    server: Server
  }
}>()

app.get("/ws", async (c) => {
  if (!c.env.server.upgrade(c.req.raw, {
    data: 'im some data for association'
  })) {
    logger.error("failed to upgrade!")
  }
  return new Response() // have to return empty response so hono doesn't get mad
})

Bun.serve({
  port: process.env.PORT || "8080",
  fetch: (req: Request, server: Server) => {
    return app.fetch(req, {
      server,
    })
  },
  websocket: {
    message(ws, msg) {
      console.log("got message", ws.data, msg)
    },
    open(ws) {
      console.log("websocket opened", ws.data)
    },
  },
)

Nice you found out! I did a console.log(c) to learn about the internals .. however not sure env is supposed to be used for this purpose??

It's because when you do the shortcut of fetch: app.fetch you are passing in (req, server), with server being the object that is assigned to the .env of hono. Because .upgrade is a method on server, you are effectively making c.env equivalent to the server argument.
This is the type for Hono.fetch
fetch: (request: Request, Env?: E['Bindings'] | {}, executionCtx?: ExecutionContext) => Response | Promise<Response>;

I don't think it's possible to handle upgrades inside the route handler itself in Bun, but it's very doable in Node. I've made a PR to address this a while ago but I didn't have much time to update it so it's stale for now.

I really like how this is done in Elysia

Elysia has the advantage of supporting only Bun in this case because implementing a ws handler function would require a lot of runtime specific code. My plan was to make a helper like this without Bun support but I've yet to PR anything.
import { upgradeWebSocket } from "hono/ws";
import { Hono } from "hono";

const app = new Hono();

app.get("/ws", (c) => upgradeWebSocket(c, (ws) => {}));

Elysia has the advantage of supporting only Bun in this case ..

I see. Hono has to do more work to support multiple runtimes. Maybe Elysia is a better if only building for Bun.

If you want to have "normal" websockets (with listeners) in Bun/hono I made this little bit of code: https://gist.github.com/tobowers/2117365c8210d1758a4c6e2f859619c0

If you want to have "normal" websockets (with listeners) in Bun/hono I made this little bit of code: https://gist.github.com/tobowers/2117365c8210d1758a4c6e2f859619c0

That's pretty nice!

If you want to have "normal" websockets (with listeners) in Bun/hono

I'd rather have the 7x performance by Bun :)

If you want to have "normal" websockets (with listeners) in Bun/hono

I'd rather have the 7x performance by Bun :)

Sure, but most libraries can't handle it.

Sure, but most libraries can't handle it.

What libraries are you referring to? (I only need a simple web framework / library which can handle routes and WebSocket but is preferably "cross-runtime")

I mean libraries consuming websockets

I mean libraries consuming websockets

Not aware of any such libraries. Just need a standard WebSocket API

Now, we have WebSocket Helper / Adapter! #2265

For someone interested in using WebSockets via node server and socket.io check out this snippet对于有兴趣通过节点服务器和 socket.io 使用 WebSockets 的人，请查看此代码片段
import { serve } from "@hono/node-server";
import { Hono } from "hono";
import type { Server as HTTPSServer } from "node:http";
import { Server as SocketIOServer } from "socket.io";

const app = new Hono();

app.get("/", (c) => c.text("Hello Hono!"));

const server = serve(
  {
    fetch: app.fetch,
    port: 5000,
  },
  (add) => {
    console.log('Listening on http://localhost:'+${add.port});
  }
);

const io = new SocketIOServer(server as HTTPSServer);

io.on("connection", (socket) => {
  socket.emit("hello", "world");
  socket.on("hello", (data) => {
    socket.broadcast.emit("hello", data);
  });
});

May I ask how to use io in a separate routing file?


Gem version that works under Rails 4

Incorrect target and not editable in a way that lets me fix it.


Fixes base64 encoding issue for images

Currently, this package returns inlined images that are binary encoded. A small tweak to the parameters being used in the "getFileString" function within resolveImageToBase64 fixes that.

Thanks for the fix @pete-reads! Would merge and republish in a while.

I never expected a PR on this repo, but I guess that's the beauty of Open Source <3. Cheers!