bug: Connection closed without receiving any events

IDE Information
IntelliJ IDEA 2024.1.4 (Ultimate Edition)
Build #IU-241.18034.62, built on June 20, 2024
Licensed to Sourcegraph / Michael Bahr
You have a perpetual fallback license for this version.
Subscription is active until April 14, 2025.
Runtime version: 17.0.11+1-b1207.24 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 14.6.1
GC: G1 Young Generation, G1 Old Generation
Memory: 8192M
Cores: 16
Metal Rendering is ON
Registry:
ide.experimental.ui=true
eslint.additional.file.extensions=svelte
Non-Bundled Plugins:
com.github.bric3.excalidraw (0.4.0)
Key Promoter X (2024.1.0)
org.jetbrains.plugins.go (241.17011.2)
com.intellij.aqua (241.18034.62)
com.intellij.lang.jsgraphql (241.14494.150)
dev.blachut.svelte.lang (241.17011.2)
com.sourcegraph.jetbrains (6.0.34)
Kotlin: 241.18034.62-IJ
Bug Description
Chat failed with an error two times, before eventually picking up again. No idea what to do except to wait and retry.

Additional context
Stacktrace: Connection closed without receiving any events

We believe this is caused by an Anthropic outage. You can view the current status here: https://status.anthropic.com/ (api.anthropic.com specifically.)
In the meantime, try using a model from a different provider.


Fix update user

Current coverage is 84.00%

Merging #16 into master will decrease coverage by -0.66% as of e42f729

@@            master    #16   diff @@
=====================================
  Files           22     22
  Stmts          848    850     +2
  Branches        91     93     +2
  Methods          0      0
=====================================
- Hit            718    714     -4
  Partial          2      2
- Missed         128    134     +6

Review entire Coverage Diff as of e42f729

Powered by Codecov. Updated on successful CI builds.


Cleanup the cancellable-counter example

Not sure what happened but the cancellable-counter example doesn't seem to be complete or was broken, also the tests don't seem to be relevant (maybe I'm wrong) and don't pass.
We should probably clean this up and get it working with tests running again.

You are right, it seems in complete in regards of tests. Example alone is working fine though - or have you experienced any issues with it too?

Are you refering to the cancellation example here: https://github.com/redux-saga/redux-saga/blob/master/docs/advanced/Channels.md#using-the-eventchannel-factory-to-connect-to-external-events?
I'm trying to create an eventEmitter which can be cancelled by an action. I'm struggling to understand how the example works though. If the code is already within the finally block then surely the eventEmitter has already finished. So how does cancellation work in this code? Perhaps it's just my lack of understanding!

Ok I've seen the full example here https://github.com/redux-saga/redux-saga/blob/master/examples/cancellable-counter/src/sagas/index.js.
It makes more sense now. Perhaps the docs should include the code for the race.

@djskinner do u still have any unanswered questions? or did the example's code clarified all the things for you?

The example code clarified everything thanks


Next.js SSG 404 on page load of dynamic route

Before opening, please confirm:

[X] I have checked to see if my question is addressed in the FAQ.
[X] I have searched for duplicate or closed issues.
[X] I have read the guide for submitting bug reports.
[X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.

App Id
SSG app: ddsf1gbrctse5 , SSR app: dc3blsn6e63vx
Region
us-east-1
Amplify Console feature
Redirects
Describe the bug
When deploying an SSG version of Next.js on Amplify initial page loads on routes that are at least partially dynamic fallback to the root index.html rather than serving the dynamic page. The same code but with an SSR build works.
Here is the (default) Rewrites and redirects logic (same for SSG and SSR):
Source address: /<*>, target address: /index.html, type: 404 (Rewrite)
SSG src: https://github.com/quinnturner/nextjs-amplify-ssg-routing
SSR src: https://github.com/quinnturner/nextjs-amplify-ssr-routing
Expected behavior
When performing next build && next export on the attached project, this is the resulting file structure:
├── 404.html
├── index.html
├── with-indexes
│   ├── [a]
│   │   ├── [b]
│   │   │   └── static.html
│   │   ├── [b].html
│   │   └── static.html
│   ├── [a].html
│   ├── static
│   │   ├── [c]
│   │   │   ├── [d].html
│   │   │   └── static.html
│   │   └── [c].html
│   └── static.html
├── with-indexes.html
├── with-named
│   ├── [a]
│   │   ├── [b]
│   │   │   └── static.html
│   │   ├── [b].html
│   │   └── static.html
│   ├── [a].html
│   ├── static
│   │   ├── [c]
│   │   │   ├── [d].html
│   │   │   └── static.html
│   │   └── [c].html
│   └── static.html
└── with-named.html

Notably, Next.js "flattens" the with-indexes approach to use named files with no index.htmls.

https://main.ddsf1gbrctse5.amplifyapp.com/with-named/a should serve /with-named/[a].html.
https://main.ddsf1gbrctse5.amplifyapp.com/with-indexes/a/b/static should serve /with-indexes/[a]/[b]/static.html

Reproduction steps

Visit the website https://main.ddsf1gbrctse5.amplifyapp.com/ (SSG build)
Click the /with-named/a in the anchor component section (or just click here: https://main.ddsf1gbrctse5.amplifyapp.com/with-named/a)
Notice that the app that is served is the fallback index.html

Build Settings
version: 1
frontend:
  phases:
    preBuild:
      commands:
        - yarn install
    build:
      commands:
        - yarn build
  artifacts:
    baseDirectory: out
    files:
      - "**/*"
  cache:
    paths:
      - node_modules/**/*

Additional information
I have tried to do various rewrites and redirects but I have not even been able to perform a workaround.

try adding this trailingSlash: true option (on next.config.js) file.

https://trailing-slash.ddsf1gbrctse5.amplifyapp.com/with-named/a/static/
Does not work

Hi, according to your src repository, uri /with-named/[a] serves /with-named/[a].html and  /with-indexes/[a]/[b]/static serves /with-indexes/[a]/[b]/static.html
Feel free to reopen if you have other question, thanks!


Mix-in routing prototype

This PR is just to demonstrate one way we could augment the mix-in client classes to accommodate routing overrides if necessary.
cc @viacheslav-rostovtsev

Closing now but leaving the branch available for future reference if necessary.


Fix documentation for overriding files

Fixed content order on overriding files documentation

Codecov Report

Merging #5331 (e3d23d7) into 1.4 (d5559d2) will not change coverage.
The diff coverage is n/a.

@@            Coverage Diff            @@
##                1.4    #5331   +/-   ##
=========================================
  Coverage     63.57%   63.57%
  Complexity     1398     1398
=========================================
  Files           195      195
  Lines          4134     4134
=========================================
  Hits           2628     2628
  Misses         1506     1506

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 d5559d2...e3d23d7. Read the comment docs.


small error issue in voxblox_skeleton

Hi, I found out the error keep comes out.
mav_voxblox_planning/voxblox_skeleton/src/io/skeleton_io.cpp:72:75: error: cannot convert ‘uint32_t* {aka unsigned int*}’ to ‘uint64_t* {aka long unsigned int*}’ for argument ‘3’ to ‘bool voxblox::utils::readProtoMsgFromStream(std::istream*, google::protobuf::Message*, uint64_t*)’
Therefore, I changed the line 69: from uint32_t tmp_byte_offset = 0; into  uint64_t tmp_byte_offset = 0; and successed to build.
I share this info with the other person who has the same problem.
I apologize if I ruined the GitHub community's rule. (I don't know where to share this kind of info.)

It works! Thank you!

Thanks it really helps!


Command copied from fish shell gets line wrap

Does this issue occur when all extensions are disabled?: Yes

VS Code Version: 1.95.3
OS Version: Arch Linux, GNOME 47

Steps to Reproduce:

Prepare a very long command in terminal.
Select the command, Copy, and Paste into a file.

Why is it important to you to maintain the line wrapping ?

Sometimes I copy arguments from my previous command into the current command. Also because I configure the terminal to be thin and tall on the right hand side, the problem is more likely to appear.
Also I don't see the behavior in my local terminal. So I suspect this is a bug from VSCode integrated terminal, instead of my tools.


Closing existing tooltips when opening a new tooltip

Hi, I'm running into an issue where if you already have a tooltip open and click on another button that activates a tooltip, you will have two tooltips open. If you click outside the tooltips, all open tooltips close which works as intended. How do I close existing tooltips when a user clicks on the button that opens a new tooltip?
I tried running this code within the onClick behavior on the buttons and surrounding divs as suggested by the docs, but it wouldn't close existing tooltips:
ReactTooltip.hide();
ReactTooltip.hide(target) Hide the tooltip manually, the target is optional, if no target passed in, all existing tooltips will be hidden

Hi @aspdev91, I'm running into the same problem. Did you find the solution ?
Thank

try to add
componentDidUpdate() {
ReactTooltip.rebuild();
}

It didn't help for me.
In my case, when I click on another tooltip, the 'click' event isn't popping up. So the ReactTooltip.hide function is never called (Mostly explaining why nothing is closed in that case).
Is that possible that the event is catch in react-tooltip and its propagation is stopped ?

Hi. I solved this problem by simply adding a property isCapture={true}

Hi. I solved this problem by simply adding a property isCapture={true}

Thanks, worked for me.


Fix serialization of optional blobs

Fixes #658.
Previously Option<Vec<u8>> would be serialized as the vector instead of as the base64-encoded value as expected by the API.

This is just a bugfix. We should be able to release a 0.25.1 version of rusoto_core to get this out ASAP. I don't think there's anything merged to master since last release that would be an issue (just code formatting and test ordering AFAICT).
We should discuss versioning and releasing though. Ideally, we'd keep master as a dev branch and create a release branch for every breaking change release so getting a fix like this released is never a concern.

Looks good to me.


Fix tutorials index on docs

Hello :octocat:
This link currently does not work: https://apalache.informal.systems/docs/tutorials/index.html. This fixes the problem and update the index context to list our newest tutorials.

Codecov Report

Merging #1528 (d622daf) into unstable (44d0db5) will decrease coverage by 0.05%.
The diff coverage is n/a.

@@             Coverage Diff              @@
##           unstable    #1528      +/-   ##
============================================
- Coverage     74.92%   74.87%   -0.06%
============================================
  Files           358      358
  Lines         11482    11482
  Branches        550      550
============================================
- Hits           8603     8597       -6
- Misses         2879     2885       +6

Impacted Files
Coverage Δ

...transformations/standard/IncrementalRenaming.scala
83.58% <0.00%> (-3.74%)
:arrow_down:

...he/io/annotations/parser/CommentPreprocessor.scala
95.60% <0.00%> (-1.10%)
: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 44d0db5...d622daf. Read the comment docs.


Change the name of "collapse all challenges" in a map menu (UX)

For not native English speakers "collapse all" sounds like "delete all challenges", so they probably never click this button.
I was always wondering why do we need such a big button to destroy all challenge's progress until I found this step in a TODO testing list and only then I've discovered this great feature :)
I'm not a native speaker, so need help with a more appropriate word.
Possible variants:

Hide all challenges
Hide all sub-challenges
Minify all challenges

Hide all challenges

This is probably the best alternate.

But keep in mind that the meaning should stay the same as "collapse", because native English speakers are still the majority.

I'd like to work on this for my first contribution

Go forth @JuFisch

@JuFisch - Are you still on it?

Marked as first-timer, @iamrudra you are assigned on one of the issues, lets keep this for some one else?

@raisedadead - Looking for help wanted led me here. It did not have first-timers-only when I put that comment. Will resolve the #10017 first and then look for another.

Great! @iamrudra thanks, looking forward to your contribution!

@raisedadead Could I take this one if @JuFisch is not on it anymore?

Unless, anyone has made a pull request, it's considered not claimed, @Rlin415 please go ahead.

Sorry for the delay, thanks for removing me. I'll try and find a new one! :)


Why you didn't build this plugin with HybridAuth?

Hello,
Out of curiosity, Why you didn't build this plugin with HybridAuth?
Thanks

In spite of it's popularity HybridAuth's development is pretty flaky. Things break too often for my liking and I end up getting tickets on my plugin. Recent example ADmad/CakePHP-HybridAuth#113.
It's seems to lack a primary maintainer who can devote enough time. The 2.x code is pretty outdated and the 3.x has been in development for too long (although checking it now it seems activity has picked up again).

Thanks for your time

An update: Hybridauth v3 still doesn't hasn't been released, stuck on rc3 for months.
There's also a minor concern like the following ticket. v3 is still slated to PHP 5.4, a version for which support has been discontinued over 3 years ago.
https://github.com/hybridauth/hybridauth/issues/904

Thanks for this update :+1:


"official" in 3.5 of the LCP spec looks useless

All official link relations used in the License Document and declared in official LCP specification documents MUST be referenced in the registry.

What does "official" mean?  I also think that "and declared in official LCP specification documents" is unnecessary and confusing.

I think the authors wanted to describe here all link relations that are part of the LCP specification, i.e. not those which may be vendor-specific extensions.
The LCP Link Relation Registry is still to be created. It will be a simple md document in this "readium-lcp-spec" folder.

We may decide to simplify the whole paragraphe (2 sentences) as:

The link relations defined in this specification are also listed in the LCP Link Relations Registry.

We find the same type of paragraph in 3.6 (Rights) and 3.7 (User). All could be simplified the same way.


Does not teleport from the bed

Add a setting in the config - something that can be teleported from the bed and so on

Sorry, but I'm not sure of what you mean

Извините, но я не понимаю, что вы имеете в виду

When you are lying in bed and the player tries to teleport you, you stay in bed


IPC GUI fix bots collapse button

If I am not wrong, the boxBodyHTML content wasn't properly placed, causing the collapse button to not work properly (collapse worked but pressing the - wasn't doing anything).

Also, I just hardcoded 'display: none;' to the box-body in my latest commit. This should fix the issue with animation not displaying the first time (yeah, it is not an AdminLTE bug).

@MrBurrBurr Please review.

I will be home on the weekend, then I will review every PR :)
Thank you all for your patience.

Fixing this made me see that when a bot is farming more than one game, the images are in a carrousel (wasn't working before). But that introduces a new bug, the first time you click the + all the images are displayed and only then the carrousel is dispalyed:

This happen because the carrousel is initialized the first time that expanded.boxwidget event is triggered, and that event is only triggered only after the animation is fully completed.
One solution can be initializing all the carousels at the page load and then pause them. But if you did it this way probably you have your reasons (I think that maybe with houndreds of bots this will use a lot of uneeded resources at the page load).
Another solution could be make all the images of the games (except the first one) invisible by default (with display: none; or any other way). Then at expanded.boxwidget event, the carrousel is initialized and then all the images are visible again.
I don't know, what do you think @MrBurrBurr? I haven't tried any of my soltions tho, if I find free time soon I will check it better.

I am reviewing this PR right now and noticed some things.

If I am not wrong, the boxBodyHTML content wasn't properly placed, causing the collapse button to not work properly (collapse worked but pressing the - wasn't doing anything).

It is placed correctly in the current version but this issue came with upgrading AdminLTE to version 2.3.4, whenever they added a fix for box inside box collapsing error. I went back to 2.3.3 and it works again.

Also, I just hardcoded 'display: none;' to the box-body in my latest commit. This should fix the issue with animation not displaying the first time (yeah, it is not an AdminLTE bug).

First I want to state that this is in fact a bug in AdminLTE. Your fix will work in this case because how the box widget is used in IPC GUI (its hidden by default).

As you noticed yourself we now got the issue with the carrousel. I will have to think about what would be the best way to fix this since it wasnt coded by me but by @felipe19930.
Of couse it would be appreciated if you could test any of your solutions and give feed back :)
Thank you for your contribution.
@JustArchi
Please dont merge this PR. I added a part of this PR into #802.

As per above. Thanks for review @MrBurrBurr


Show opening/pawn structure doesn't work correctly for swiss tournaments

Example URL : https://lichess.org/swiss/Egco6X5f

fixed in v2.3.14


Mac M1 - Ubuntu image not running under ARM architecture

How can the ubuntu image be run on Mac M1 on ARM architecture?
I am using the following setup:

Mac M1 with MacOS 13.0.1
Docker Desktop 4.16.2 with Rosetta enabled
Visual Studio Code 1.17.3

Using the devcontainer.json below, processes are running on x86 arch as uname shows:
# uname -m
x86_64

How can the devcontainer run on ARM?
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/devcontainers/images/tree/main/src/base-ubuntu
{
  "name": "Ubuntu",
  "image": "mcr.microsoft.com/devcontainers/base:ubuntu",
  // Set *default* container specific settings.json values on container create.
  "settings": {
    "python.defaultInterpreterPath": "/usr/local/bin/python",
    "python.linting.enabled": true,
    "python.linting.pylintEnabled": true,
    "python.formatting.autopep8Path": "/usr/local/py-utils/bin/autopep8",
    "python.formatting.blackPath": "/usr/local/py-utils/bin/black",
    "python.formatting.yapfPath": "/usr/local/py-utils/bin/yapf",
    "python.linting.banditPath": "/usr/local/py-utils/bin/bandit",
    "python.linting.flake8Path": "/usr/local/py-utils/bin/flake8",
    "python.linting.mypyPath": "/usr/local/py-utils/bin/mypy",
    "python.linting.pycodestylePath": "/usr/local/py-utils/bin/pycodestyle",
    "python.linting.pydocstylePath": "/usr/local/py-utils/bin/pydocstyle",
    "python.linting.pylintPath": "/usr/local/py-utils/bin/pylint"
  },
  // Add the IDs of extensions you want installed when the container is created.
  "extensions": [
    "ms-python.python",
    "ms-python.vscode-pylance",
    "ms-azuretools.vscode-docker",
    "Splunk.splunk",
    "esbenp.prettier-vscode",
    "dbaeumer.vscode-eslint",
    "steoates.autoimport",
    "mgmcdermott.vscode-language-babel",
    "streetsidesoftware.code-spell-checker",
    "shivanshu-gupta.scratchpads",
    "thenuprojectcontributors.vscode-nushell-lang"
  ],
  // Use 'forwardPorts' to make a list of ports inside the container available locally.
  // "forwardPorts": [],
  // Use 'postCreateCommand' to run commands after the container is created.
  // "postCreateCommand": "pip3 install --user -r requirements.txt",
  // Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
  "remoteUser": "vscode",
  "remoteEnv": {
    "LOCAL_WORKSPACE_FOLDER": "${localWorkspaceFolder}"
  },
  "features": {
    "ghcr.io/devcontainers/features/docker-outside-of-docker:1": "latest",
    "ghcr.io/devcontainers/features/node:1": {
      "version": "16"
    },
    "ghcr.io/devcontainers/features/python:1": {
      "version": "3.7"
    }
  }
}

Hi 👋
Have you tried using the Dev Containers Extension to open this in a container?
Nit: The settings & extensions should be within customizations.vscode object. Sample here

@samruddhikhandale yes, I used the Dev Containers Extension to open this in a container - Is there any other way of doing it?

I was double checking if you are using the extension or working in a Codespace.
The ubuntu image is built for multi-arch/multi-platform support and supports arm.
I tried to reproduce with your dev config, architecture looks good to me 👇

Mac M1 Max with MacOS 13.0.1
Docker Desktop 4.16.2
Visual Studio Code 1.75.1

@chrmarti are you aware why the user might be seeing x86_64 instead of aarch64 or arm64 ?

@samruddhikhandale did you enable Rosetta? I remember having the same issue with qemu, but definitely have it now using Rosetta.

I was able to randomly reproduce this with 👇  devcontainer.json
{
	"name": "Ubuntu",
	"image": "mcr.microsoft.com/devcontainers/base:ubuntu"
}

If you look at the devcontainer-info result, then the image looks cached and is very old. Removing the image from my local cache and rebuilding the container fixed it for me.

@marcusschiesser Can you try that?

@samruddhikhandale did you enable Rosetta? I remember having the same issue with qemu, but definitely have it now using Rosetta.

I still don't have Rosetta enabled but was able to reproduce this issue. Thus, Rosetta might not be relevant 🤔

@samruddhikhandale Hmm, that's interesting. I just did what you said (Removing the image from the local cache and rebuilding the container), and I still get x86 with the latest image:

That's the VS that I am using:

Can't upgrade to 1.75.x because of https://github.com/microsoft/vscode-remote-release/issues/7974

[2314012 ms] [2023-08-08T15:33:13.038Z] Failed to get registry auth token with error: Error: HTTP 403: Forbidden
[2314151 ms] [2023-08-08T15:33:13.177Z] Failed to fetch template manifest for ghcr.io/devcontainers/templates/docker-existing-dockerfile:latest

[1862535 ms] Start: Run: docker version --format {{.Server.APIVersion}}
[1863118 ms] 1.43
[1880056 ms] No dev container config found. Additional locations checked:

/Users/jyn/.vscode/extensions/ms-vscode-remote.remote-containers-0.266.1/dist/node_modules/vscode-dev-containers/repository-containers/github.com/redjack/sensor/.devcontainer/devcontainer.json
[1888802 ms] Start: Run: /private/var/folders/0c/cvw1ywdj5c3b73kt13g4svyw0000gr/T/AppTranslocation/823B01AE-DA24-406C-808C-4F26ABDFD158/d/Visual Studio Code.app/Contents/Frameworks/Code Helper.app/Contents/MacOS/Code Helper --ms-enable-electron-run-as-node /Users/jyn/.vscode/extensions/ms-vscode-remote.remote-containers-0.266.1/dist/spec-node/devContainersSpecCLI.js templates apply --workspace-folder /var/folders/0c/cvw1ywdj5c3b73kt13g4svyw0000gr/T/tmp-output-dir-1691508367826 --template-id ghcr.io/devcontainers/templates/docker-existing-docker-compose:latest --template-args {} --features [] --tmp-dir /var/folders/0c/cvw1ywdj5c3b73kt13g4svyw0000gr/T/tmp-dir-1691508367826
[1888980 ms] [2023-08-08T15:26:08.005Z] @devcontainers/cli 0.25.2. Node.js v16.14.2. darwin 22.6.0 arm64.
[1889216 ms] [2023-08-08T15:26:08.242Z] HTTP request failed with status code 403: : Forbidden
[1889217 ms] [2023-08-08T15:26:08.243Z] Failed to get registry auth token with error: Error: HTTP 403: Forbidden
[1889357 ms] [2023-08-08T15:26:08.382Z] Failed to fetch template manifest for ghcr.io/devcontainers/templates/docker-existing-docker-compose:latest
[1889357 ms] [2023-08-08T15:26:08.382Z] Failed to fetch template 'ghcr.io/devcontainers/templates/docker-existing-docker-compose:latest'.
[1889360 ms] Exit code 1


Update to Verilator 4.210

(This PR also includes the commits from #7964, which currently fail CI due to a Verilator segfault. These commits will be removed if the update actually fixes the CI problems.)
Update to Verilator 4.210 to fix a segfault within Verilator, which appeared recently in our code base.

Thanks Philipp. Two minor comments on the upgrade commit:

It would be good to record in the commit message that the update works around what seems to be a bug in Verilator
I think you need to update the VERILATOR_VERSION in util/container/Dockerfile

FYI: @rasmus-madsen.   Can we get a module for this?

Ok, I'll look into updating Verilator today. I will let you know once this is ready on our side.

thanks Michael!
On Tue, Aug 31, 2021 at 10:23 AM Michael Schaffner @.***>
wrote:

Ok, I'll look into updating Verilator today. I will let you know once this
is ready on our side.
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub
https://github.com/lowRISC/opentitan/pull/8004#issuecomment-909435145,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAH2RSVCMHTTKEWWNDOT4W3T7UFXJANCNFSM5DEJPC4Q
.
Triage notifications on the go with GitHub Mobile for iOS
https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675
or Android
https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

Ok, I'll look into updating Verilator today. I will let you know once this is ready on our side.

Ok this does not seem as straightforward as I initially thought.
Since our runners use CentOS7 for the tooling environment, we're building this on a CentOS7 docker container which by default uses an older GCC version (4.8.5).
However, so far, this has worked fine, but the Verilator 4.210 version needs a small patch to get compilation going: https://github.com/verilator/verilator/pull/3110
I tried to upstream this patch, but unfortunately the current development version on master has even more new constructs / compiler flags that are not understood by GCC 4.8.5.
So, this means that for now, we can get Verilator 4.210 working, but further down the road this may get more complicated for us to do with the same environment.
I'll report back once we've installed Verilator 4.210 with this patch.

@msfschaffner Can you make use of RHEL software collections (SCLs) that provide you with a newer compiler? GCC 4.8 is also too old to build OpenTitan, so it's likely you already have something in place for that.

We probably have to do something like that, yes.
The issue is that we are currently using an existing CentOS 7 image that we do not own, so we have to change our flow a bit in the future.

We probably have to do something like that, yes.
The issue is that we are currently using an existing CentOS 7 image that we do not own, so we have to change our flow a bit in the future.

We are enabling devtoolset-7 via SCL on our centos image which should give us GCC 7.x. Lets sync up offline to figure out what's going on.

We probably have to do something like that, yes.
The issue is that we are currently using an existing CentOS 7 image that we do not own, so we have to change our flow a bit in the future.

We are enabling devtoolset-7 via SCL on our centos image which should give us GCC 7.x. Lets sync up offline to figure out what's going on.

OK sounds good!

We are already using gcc 9.3 on our RHEL7 systems.  I'll give that a try with the new Verilator and let everyone know how it goes.

Sorry for the late response - we've updated Verilator on our end as well.

@martin-lueker @rasmus-madsen How are things going on your side?

Hi @imphil,
I've installed verilator 4.210 on our system, just testing it now.

Hi @imphil (FYI @rasmus-madsen):  It took a while, but I was able to run the verilator test with some changes (see #8245 for details)

Thanks a lot @martin-lueker! I've rebased and will merge this then, and I'll follow up in #8245 with comments on how to make Verilator work for your setup again.


Example for string/int,  String/string khash usage

It took me a while to figure out how to use khash from the built in example.   I saw similar complaints on other blog pages so I don't think I am unique.   I suggest adding the following as file to the repository as an example and modifying the home page of the repository to link to it.     It compiled and ran fine with gcc with the std=c11 flag set.
// khash example for string key int payload.  And string key with string payload.
//
// javadoc style docs
//   http://samtools.sourceforge.net/samtools/khash/index.html?PDefines/PDefines.html
// https://attractivechaos.wordpress.com/2008/09/02/implementing-generic-hash-library-in-c/
// https://attractivechaos.wordpress.com/2009/09/29/khash-h/
// https://attractivechaos.wordpress.com/tag/hash/
// Wrapper code for khash which is a good start for wrapping khash for ffi access from luajit.
//   https://github.com/attractivechaos/klib/issues/44

#include <stdio.h>
#include <stdlib.h>
#include "khash.h"

// shorthand way to get the key from hashtable or defVal if not found
#define kh_get_val(kname, hash, key, defVal) ({k=kh_get(kname, hash, key);(k!=kh_end(hash)?kh_val(hash,k):defVal);})

// shorthand way to set value in hash with single line command.  Returns value
// returns 0=replaced existing item, 1=bucket empty (new key), 2-adding element previously deleted
#define kh_set(kname, hash, key, val) ({int ret; k = kh_put(kname, hash,key,&ret); kh_value(hash,k) = val; ret;})

// name part of init must be unique for the key, value types.
// in this instance 33 is arbitrary symbolic name for a hashtable
// that contains string keys and int values.
const int khStrInt = 33;
KHASH_MAP_INIT_STR(khStrInt, int) // setup khash to handle string key with int payload
int string_key_int_body_example()
{
   printf("\n\nBegin khash test string key with int payload\n");
   int ret, is_missing;
   khiter_t k;
   khash_t(khStrInt) *h = kh_init(khStrInt); // create a hashtable

   // Add a value Key "apple" to the hashtable
   k = kh_put(khStrInt, h, "apple", &ret); // add the key
   kh_value(h, k) = 10; // set the value of the key

   // shorthand way to set a value in the
   // with a macro
   kh_set(khStrInt, h, "jimbo", 99);
   kh_set(khStrInt, h, "john haze", 98);
   kh_set(khStrInt, h, "jaki joiner", 97);

   // Retrieve the value for key "apple"
   k = kh_get(khStrInt, h, "apple");  // first have to get ieter
   if (k == kh_end(h)) {  // k will be equal to kh_end if key not present
      printf("no key found for apple");
   } else {
      printf ("key at apple=%d\n", kh_val(h,k)); // next have to fetch  the actual value
   }

   // Retrieve the value for key "apple"
   k = kh_get(khStrInt, h, "john haze");  // first have to get ieter
   if (k == kh_end(h)) {  // k will be equal to kh_end if key not present
      printf("no key found for john haze\n");
   } else {
      printf ("key at john haze=%d\n", kh_val(h,k)); // next have to fetch  the actual value
   }

   // retreive key for the key "not_present"
   // which should print the error message
   k = kh_get(khStrInt, h, "not_present");  // first have to get ieter
   if (k == kh_end(h)) {  // k will be equal to kh_end if key not present
      printf("no key found for not_present\n");
   } else {
      printf ("key at not_present=%d\n", kh_val(h,k)); // next have to fetch  the actual value
   }

   // shorthand method to get value that returns value found
   // or specified default value if not present.
   int tval = kh_get_val(khStrInt, h, "apple", -1);
   printf ("shortcut tval for apple = %d\n", tval);

   tval = kh_get_val(khStrInt, h, "john haze", -1);
   printf ("shortcut tval for john haze = %d\n", tval);

   // missing key should return default value of -1
   tval = kh_get_val(khStrInt, h, "not_present", -1);
   printf ("shortcut tval for not_present = %d\n", tval);

   // Try to delete a key and then retrieve it
   // to see if it is really gone.
   k = kh_get(khStrInt, h, "john haze"); // get the ieterator
   if (k != kh_end(h)) {  // if it is found
      printf("deleting key john_haze\n");
      kh_del(khStrInt, h, k);  // then delete it.
   }
   // now see if it is really gone
   tval = tval = kh_get_val(khStrInt, h, "john haze", -1);
   printf ("after delete tval for john haze = %d\n", tval);

   // Ieterate the hash table by key, value and print out
   // the values found.
   printf("\nIeterate all keys\n");
   for (k = kh_begin(h); k != kh_end(h); ++k) {
      if (kh_exist(h, k)) {
         const char *key = kh_key(h,k);
         tval = kh_value(h, k);
         printf("key=%s  val=%d\n", key, tval);
      }
   }

   // cleanup and remove our hashtable
   kh_destroy(khStrInt, h);
   return 0;
}

char *missing = "MISSING";
const int khStrStr = 32;
KHASH_MAP_INIT_STR(khStrStr, char*); // setup khash to handle string key with string body
int str_key_str_body_example()
{
   printf("\n\nBegin khash test string key with string payload\n");
   int ret, is_missing;
   khiter_t k;
   khash_t(khStrStr) *h = kh_init(khStrStr); // create a hashtable

   // Add a value Key "apple" to the hashtable
   k = kh_put(khStrStr, h, "apple", &ret); // add the key
   kh_value(h, k) = "fruit"; // set the value of the key

   // shorthand way to set a value in hash with single line.
   kh_set(khStrStr, h, "jimbo", "artist");
   kh_set(khStrStr, h, "john haze", "engineer");
   kh_set(khStrStr, h, "jaki joiner", "architect");

   // Retrieve the value for key "apple"
   k = kh_get(khStrStr, h, "apple");  // first have to get ieter
   if (k == kh_end(h)) {  // k will be equal to kh_end if key not present
      printf("no key found for apple");
   } else {
      printf ("key at apple=%s\n", kh_val(h,k)); // next have to fetch  the actual value
   }

   // Retrieve the value for key "apple"
   k = kh_get(khStrStr, h, "john haze");  // first have to get ieter
   if (k == kh_end(h)) {  // k will be equal to kh_end if key not present
      printf("no key found for john haze\n");
   } else {
      printf ("key at john haze=%s\n", kh_val(h,k)); // next have to fetch  the actual value
   }

   // retreive key for the key "not_present"
   // which should print the error message
   k = kh_get(khStrStr, h, "not_present");  // first have to get ieter
   if (k == kh_end(h)) {  // k will be equal to kh_end if key not present
      printf("no key found for not_present\n");
   } else {
      printf ("key at not_present=%s\n", kh_val(h,k)); // next have to fetch  the actual value
   }

   // shorthand method to get value that returns value found
   // or specified default value if not present.   Would normally
   // use NULL default if key is not present but easier to printf
   // a real value.
   char *tval = kh_get_val(khStrStr, h, "apple", missing);
   printf ("shortcut tval for apple = %s\n", tval);

   tval = kh_get_val(khStrStr, h, "john haze", missing);
   printf ("shortcut tval for john haze = %s\n", tval);

   // missing key should return default value of -1
   tval = kh_get_val(khStrStr, h, "not_present", missing);
   printf ("shortcut tval for not_present = %s\n", tval);

   // Try to delete a key and then retrieve it
   // to see if it is really gone.
   k = kh_get(khStrStr, h, "john haze"); // get the ieterator
   if (k != kh_end(h)) {  // if it is found
      printf("deleting key john_haze\n");
      kh_del(khStrStr, h, k);  // then delete it.
   }
   // now see if it is really gone
   tval = tval = kh_get_val(khStrStr, h, "john haze", missing);
   printf ("after delete tval for john haze = %s\n", tval);

   // Ieterate the hash table by key, value and print out
   // the values found.
   printf("\nIeterate all keys\n");
   for (k = kh_begin(h); k != kh_end(h); ++k) {
      if (kh_exist(h, k)) {
         const char *key = kh_key(h,k);
         tval = kh_value(h, k);
         printf("key=%s  val=%s\n", key, tval);
      }
   }

   // cleanup and remove our hashtable
   kh_destroy(khStrStr, h);
   return 0;
}

int main()
{
   string_key_int_body_example();
   str_key_str_body_example();
}

Kudos!  It's so not obvious.  We need a table of numbers and what type of hash table they correspond with.

Really helpful. This should go on the wiki

I agree with all of the above. Why has this not at least been put into the README as a link, @attractivechaos? It would really help adoption; I wanted to use this library since the end of last year but ended up writing my own map implementation because khash looked so user-unfriendly! (Of course mine is still nowhere near as fast.)

See also:
http://attractivechaos.github.io/klib/#Khash%3A generic hash table

@attractivechaos: your page doesn't show how to use string keys with khash, which is what 80%+ of users will want, hence I suggest putting joeatbayes's example on that page directly. HTH.

It would be nice to have all the documentation on this repo wiki, I'll try to make a PR with this.

@ArcaneEngineer check out the 2nd example. It is more general as it shows how to work with strings allocated on heap (i.e. with malloc() and new). The example above only works with constant string keys.

You make a good point. I should have added examples that show dynamically allocated keys and values.    I actually use khash mostly with dynamically allocated strings  I had used the constant keys as a simplification for the example.   I could post a new file that includes the dynamically allocated keys and values.  Once you add the file to the kHash repository and grant me write access I will update it to include the dynamically allocated values and generate a pull request.    I like the http://attractivechaos.github.io/klib/#Khash%3A generic hash table and could not have written my examples without it.   I would love to see my examples added to that page but I think they are OK in the Git as a file in the docs directory where they are easier to test.
My main problem is I write in about 15 languages for different clients so I need examples that are  explicit and simplified for somebody who has forgot 1/2 the language to get back up to speed when I jump back into projects. People who spend all their time in C probably wouldn't need my examples.

Hey @jvonmitchell  I think what you are actually asking for is a union that could store a variety of different structures and a byte or int indicator that indicates what we have actually stored in the union.     It would move us closer to the bag style hash we get in Javascript and Python but you would have to edit the union every time you add a new structure type.   Another option would be to use a small structure that includes a byte level object type indicator and a void pointer.  You would then need helpers to convert to the underlying objects into and out of the void pointer.
The advantage of the union is it is a fully supported cast operation but it entails a little more explicit maintenance where with the void pointer style you can add new object types just by writing new helpers and all the helpers don't have to live in the same source module.  I think those comfortable with K&R would prefer the void pointer style while those more comfortable with Java and C++ would prefer the union.
If you send more a little more data I on exactly what you are trying to accomplish I may be able to add them to the examples.    I figure this is my duty since I am getting value from the excellent work done by @attractivechaos on khash I should try add a little value back.

Is it safe to assume that khash does not support struct values presently? I've tried and tried and every time I write a new struct value into the hash, all other keys/values seem to get cleared.

You can easily use structs. I have used it many times.
From: Arcane Engineer<EMAIL_ADDRESS>Sent: Wednesday, November 4, 2015 2:11 PM
To: attractivechaos/klib<EMAIL_ADDRESS>Cc: Joseph Ellsworth<EMAIL_ADDRESS>Subject: Re: [klib] Example for string/int, String/string khash usage (#49)
Is it safe to assume that khash does not support struct values presently? I've tried and tried and every time I write a new struct value into the hash, all other keys/values seem to get cleared.
—
Reply to this email directly or view it on GitHub https://github.com/attractivechaos/klib/issues/49#issuecomment-153885217 .  https://github.com/notifications/beacon/AGaG8BkqODa3SAFYAhzgIYu2TBrFao9iks5pCnnigaJpZM4ER8sM.gif

@joeatbayes thanks a lot for your example with every operation commented! I'm new to C and don't want to mess my head up with pointers to multidimensional arrays. Fortunately, khash fits perfectly, but the official documentation as well as comments in headers didn't help a lot.

While I appreciate the example @joeatbayes provided it led me merrily down the wrong path.  The problem is that the line marked "add the key" with the key "apple" does not, in that instance add the key. What it adds is a pointer to the key.  In the example with static strings it doesn't matter.  In my program where keys were being generated dynamically and not stored things did not go well.  This is because if all keys sent to kh_put() from the same buffer this line of code in that routine
!(strcmp (h->keys[i], key) == 0)
always has the same value.
The documentation on kh_put() in khash.h currently says:
@param  k     Key [type of keys]
perhaps it might say:
@param  k     Key [type of keys] (if the key is a pointer its contents must remain in memory)
or something along those lines.

You need to use strdup() to duplicate the key and free the memory when you delete the key or when you destroy the entire hash table. See example 3 here.

PS: when you keep the pointers to strings elsewhere, example 2 in the documentation page is preferred as it does not duplicate the string contents.

On 22-Aug-2016 06:33, Attractive Chaos wrote:

PS: when you keep the pointers to strings elsewhere, example 2 in the
documentation
page
is preferred as it does not duplicate the string contents.

Thanks for the pointers and the code.  I managed to get it working by
myself eventually, it just took longer than I thought it would.
A couple of other comments and suggestions:

kh_get returns a kh_iter_t, and kh_put returns a kh_int_t.  That
isn't consistent, even though the value returned is used in the same
way.  It happens that kh_int_t and kh_iter_t are the same thing when the
compiler acts on khash.h in my example.  It wasn't clear if that was
guaranteed to always be the case.

In order to figure out what

KHASH_SET_INIT_STR(str);
did I ran my program through the preprocessor.  Only at that point was
it clear to me that multiple string key -> int value
hash tables could share "str", and not need "strA", "strB", "strC".
No way to tell from the examples because they just use one hash
table each.  I found it easier to work with the code in the expanded
form and left it that way in my program.  It let me drop print
statements and use profiling and the debugger more easily to trace
things into your code.  (Remember, I had to figure out where I was going
wrong.)  I also added and used these inline functions (sorry about the
wrap):
static inline void kh_set_byIter_khStrUint32(kh_StrUint32_t * h,
khiter_t k, uint32_t val) {
h->vals[k] = val;
}
static inline uint32_t kh_get_byIter_khStrUint32(kh_StrUint32_t * h,
khiter_t k) {
return(h->vals[k]);
}

In the documentation there are no suggestions for the initial size
of the array if the number elements to be inserted is known.  I had to
look at the code produced by the preprocessor to see exactly how things
were being stored - some hash methods chain values out from the bucket,
others use only buckets, which is the case here.  Knowing that, an
initial size equal to the number of keys would have worked (after it
resized) but would have been a bad choice.  In my application ~280
million key/value pairs were being loaded, and there are a couple of
ancillary hash tables, with the final size of all the structures ~35G,
so minimizing the rounds of reallocation seemed like a good idea.  I
used 1.4 * number of keys for storage, and it seems to work fairly well

load everything then release all memory and quit takes about 12m40s,
with no unexpected realloc() events.  It would be nice if the
documentation gave a hint or two on this topic.

The example might mention that using a separate strdup() for each
string key or pointer to a value struct which is stored is not as
efficient for either speed or space as placing the keys one after the
other in one or a few large buffers.  Doing it in big chunks eliminates
the overhead of all the strdup() and free() calls and the memory wasted
in the memory bookkeeping structures.  The down side is that doing so
makes removing keys or pointer values difficult.  However, a lot of
programs just load, process, and quit, so that issue never comes up in
that context.

Thanks,
David Mathog
<EMAIL_ADDRESS>Manager, Sequence Analysis Facility, Biology Division, Caltech

Yes! I just spent an hour debugging why kh_exist doesn't do the thing I want and the k == kh_end(h) method does the trick. Looks like kh_del will update the flags, but I don't know why kh_exist still returns true after that.

@makmanalp Sorry. kh_exist tests if a bucket in the hash table has ever been filled before. If an element is deleted with kh_del, it still takes up the bucket, so kh_exist returns true.
Anyway, kh_exist is not properly named. It is confusing. I would use another name if I started from scratch again.

@mathog Thanks for the suggestions.

In the current code, khiter_t is only used in the example, not elsewhere. Both kh_put and kh_get returns khint_t.

When I was debugging macros, I always expand it with gcc -E and indent. I wish C also had template. Then I wouldn't have written long macros just for generics.

The khash doc page says: "generic hash table with open addressing". Open addressing means the hash table uses a single array rather than chaining.

What you said is true, but before recommending against strdup, I need to do a micro benchmark to see how much time is really spent on strdup. It would be a premature optimization if strdup took much less time than hash table operations.

@attractivechaos No apology needed - thanks for an awesome library!

Thank you a lot for this helpful examples! I was not able to figure it out myself.
Do you maybe know if it is possible to add two values into the hash table,  so that a key has two values stored like:
key string --> value_one, value_two

Not directly but it is pretty easy to accomplish.      Simply create an object such as a linked list that contains pointers to the object you want to store.  You add the linked list to the hash at key.   You can just store a linked list in every node but that entails additional overhead if you do not expect most nodes to contain multiple elements.        To avoid the overhead you can create as base type then convert to linked list when you add the 2nd item.       You can use a union that contains a 1 bytes flag indicating type of object stored.  EG:  When the byte=1 then the pointer stored to a single object of based object type.    When the byte=2 then the pointer store points to a linked list.
I am accepting new consulting projects please contact me<PHONE_NUMBER> if you have a problem and budget.

That is an interesting idea, thank you. But the part what made me confuse is more, how would you define the type of your hashtable than, as in your examples you use something like:
KHASH_MAP_INIT_STR(khStrInt, int)
So if your value is an object, would you just define it as a void* pointer?
KHASH_MAP_INIT_STR(khStrInt, void*)

@joeatbayes Thanks for the explanation. I will show a tiny example to see it helps (not tested).
#include "khash.h"
typedef struct {
  int x, y;
} myval_t;
KHASH_MAP_INIT_STR(str, myval_t)
int main(void) {
  khash_t(str) *h;
  khint_t k;
  int absent;
  h = kh_init(str);
  k = kh_put(str, h, "foo", &absent);
  kh_val(h, k).x = 1;
  kh_val(h, k).y = 2;
  k = kh_get(str, h, "foo");
  if (k != kh_end(h))
    printf("%d,%d\n", kh_val(h,k).x, kh_val(h,k).y);
  // if keys are allocated on heap, free them before calling kh_destroy()
  kh_destroy(str, h);
  return 0;
}

I like the example.   You could also  use the following if you wanted a variable length object.
typedef struct {
linkedList *ll;
} myval_t;
I most often work on engines and parser where the  dominant use case is  0,1,N where N could be anywhere from 2 to millions of sub objects depending on what you are parsing so the LL or nested hash is a common use case.
Another common tactic is a object type value combined with a object pointer so the code can check to see what is stored and cast the pointer approximately.   This allows nearly infinite flexibly in what is stored in the child buckets and they can be defined by the app programmer.    You see a lot of this kind of code in the very low level OS internals where performance is critical.    The problem is that it can also be difficult for other engineers to diagnose.   You can recognize code written by a C programmer who grew up writing assembler because it will often contain something similar.
typedef struct {
byte objType;
void *objptr;
} myval_t;
A more maintainable way uses a union so the object type byte still indicates what is stored but you have a specific subset of allowed data types and you can reference them with lest casting mess in the underlying access code.
union DataBucket {
int i;
float f;
char str[20];
linkedlist *ll;
} dataBucket;
typedef struct {
byte objType;
dataBucket  myData;
} myval_t;
when objtype == 0 then databucket contains int
when objtype == 1 then databucket contains float
when objtype == 2 then databucket contains str[20]
when objtype == 3 then databucket contains linkedlist *
any other values would be invalid.

I was wondering if your const khStrInt is defining the length of your char* array you want to add to the hashtable?

@tinaze please create a free repository with your example code. It is hard to read in the comment.

@attractivechaos  is there a few examples of multi-key  usage with using khash ?

There are a few possible ways. I would recommend to keep actual values in a separate array. In the hash map, the value is the index of the value in the value array. There are also other approaches. For example, you can use two hash tables. With the first table, you map multiple keys to a unique key. In the second table, you map the unique keys to values. The implementation also depends on the query you want to perform. If you want to get all keys associated with a value, you should build the hash table in the reverse way. If multiple keys associated with the same value are not equivalent, you will need multiple hash tables. "Multi-key" is somewhat ambiguous to me. The optimal implementation depends on the actual problem.

@lh3  thank you ！ "Multi-key" means multiple keys as you understood .

Could some please check my code and tell me if I am leaking memory?
What my code does ist to malloc 2 structs and add it to HashTable.
Now I dont know, if I need to free the two malloced structs and if yes, how?
#include "khash.h"
typedef struct {
int id;
char *stream;
int len;
} myval_t;
int type = 0;
KHASH_MAP_INIT_INT(type, myval_t)
int main(void) {
khash_t(type) *h;
khint_t k;
int absent;
h = kh_init(type);
//create struct1 and add it to hashtable
myval_t *cl1 = malloc(sizeof(myval_t));
cl1->id = 55;
cl1->len = 3;
cl1->stream = malloc(sizeof(char)*(cl1->len+1));
memcpy(cl1->stream, "abc", cl1->len);
cl1->stream[cl1->len] = '\0';
k = kh_put(type, h, cl1->id, &absent);
kh_val(h, k) = *cl1;

//create struct2 and add it to hashtable
myval_t *cl2 = malloc(sizeof(myval_t));
cl2->id = 56;
cl2->len = 3;
cl2->stream = malloc(sizeof(char)*(cl2->len+1));
memcpy(cl2->stream, "xyz", cl2->len);
cl2->stream[cl2->len] = '\0';
k = kh_put(type, h, cl2->id, &absent);
kh_val(h, k) = *cl2;

//search for specific index
printf("Searching index %d\n", 55);
k = kh_get(type, h, 55);
if (k != kh_end(h)){
	printf("Index %d found: ", kh_val(h,k).id);
	printf("%d,%s\n", kh_val(h,k).id, kh_val(h,k).stream);
}

//traverse all indexes:
printf("\nPrint all Indexes\n");
for (k = kh_begin(h); k != kh_end(h); ++k){
	if (kh_exist(h, k)){
		printf("%d,%s\n", kh_val(h,k).id, kh_val(h,k).stream);

	}
}

printf("\nremove all indexes and free malloced space\n");
//remove all and free before
for (k = kh_begin(h); k != kh_end(h); ++k){
	if (kh_exist(h, k)){
		free(kh_val(h,k).stream); //freeing malloced char within structure
		//free(kh_val(h,k)); //<-- How to free the structs malloced before?
	}
}

printf("\ndone\n");

kh_destroy(type, h);
return 0;

}

Could some please check my code and tell me if I am leaking memory?
What my code does ist to malloc 2 structs and add it to HashTable.
Now I dont know, if I need to free the two malloced structs and if yes, how?
#include "khash.h"
typedef struct {
int id;
char *stream;
int len;
} myval_t;
int type = 0;
KHASH_MAP_INIT_INT(type, myval_t)
int main(void) {
khash_t(type) *h;
khint_t k;
int absent;
h = kh_init(type);
//create struct1 and add it to hashtable
myval_t *cl1 = malloc(sizeof(myval_t));
cl1->id = 55;
cl1->len = 3;
cl1->stream = malloc(sizeof(char)*(cl1->len+1));
memcpy(cl1->stream, "abc", cl1->len);
cl1->stream[cl1->len] = '\0';
k = kh_put(type, h, cl1->id, &absent);
kh_val(h, k) = *cl1;

//create struct2 and add it to hashtable
myval_t *cl2 = malloc(sizeof(myval_t));
cl2->id = 56;
cl2->len = 3;
cl2->stream = malloc(sizeof(char)*(cl2->len+1));
memcpy(cl2->stream, "xyz", cl2->len);
cl2->stream[cl2->len] = '\0';
k = kh_put(type, h, cl2->id, &absent);
kh_val(h, k) = *cl2;

//search for specific index
printf("Searching index %d\n", 55);
k = kh_get(type, h, 55);
if (k != kh_end(h)){
	printf("Index %d found: ", kh_val(h,k).id);
	printf("%d,%s\n", kh_val(h,k).id, kh_val(h,k).stream);
}

//traverse all indexes:
printf("\nPrint all Indexes\n");
for (k = kh_begin(h); k != kh_end(h); ++k){
	if (kh_exist(h, k)){
		printf("%d,%s\n", kh_val(h,k).id, kh_val(h,k).stream);

	}
}

printf("\nremove all indexes and free malloced space\n");
//remove all and free before
for (k = kh_begin(h); k != kh_end(h); ++k){
	if (kh_exist(h, k)){
		free(kh_val(h,k).stream); //freeing malloced char within structure
		//free(kh_val(h,k)); //<-- How to free the structs malloced before?
	}
}

printf("\ndone\n");

kh_destroy(type, h);
return 0;

}

Could some please check my code and tell me if I am leaking memory?
What my code does ist to malloc 2 structs and add it to HashTable.
Now I dont know, if I need to free the two malloced structs and if yes, how?
#include "khash.h"
typedef struct {
	int id;
	char *stream;
	int len;
} myval_t;

int type = 0;
KHASH_MAP_INIT_INT(type, myval_t)
int main(void) {
	khash_t(type) *h;
	khint_t k;
	int absent;
	h = kh_init(type);

	//create struct1 and add it to hashtable
	myval_t *cl1 = malloc(sizeof(myval_t));
	cl1->id = 55;
	cl1->len = 3;
	cl1->stream = malloc(sizeof(char)*(cl1->len+1));
	memcpy(cl1->stream, "abc", cl1->len);
	cl1->stream[cl1->len] = '\0';
	k = kh_put(type, h, cl1->id, &absent);
	kh_val(h, k) = *cl1;

	//create struct2 and add it to hashtable
	myval_t *cl2 = malloc(sizeof(myval_t));
	cl2->id = 56;
	cl2->len = 3;
	cl2->stream = malloc(sizeof(char)*(cl2->len+1));
	memcpy(cl2->stream, "xyz", cl2->len);
	cl2->stream[cl2->len] = '\0';
	k = kh_put(type, h, cl2->id, &absent);
	kh_val(h, k) = *cl2;

	//search for specific index
	printf("Searching index %d\n", 55);
	k = kh_get(type, h, 55);
	if (k != kh_end(h)){
		printf("Index %d found: ", kh_val(h,k).id);
		printf("%d,%s\n", kh_val(h,k).id, kh_val(h,k).stream);
	}

	//traverse all indexes:
	printf("\nPrint all Indexes\n");
	for (k = kh_begin(h); k != kh_end(h); ++k){
		if (kh_exist(h, k)){
			printf("%d,%s\n", kh_val(h,k).id, kh_val(h,k).stream);

		}
	}

	printf("\nremove all indexes and free malloced space\n");
	//remove all and free before
	for (k = kh_begin(h); k != kh_end(h); ++k){
		if (kh_exist(h, k)){
			free(kh_val(h,k).stream); //freeing malloced char within structure
			//free(kh_val(h,k)); //<-- How to free the structs malloced before?
		}
	}

	printf("\ndone\n");

	kh_destroy(type, h);
	return 0;
}

@filly86 This is a general answer for "is my program leaking".  With a package like khash which does a lot of preprocessor expansion, so that one line may become dozens, I have found the easiest way to debug an issue like that is to first run the program through the C preprocessor only and save that.  Then compile with "gcc -g -O0".  Finally, run it in valgrind.  If there is a leak valgrind will find it and the line numbers in the expanded program will have enough notes from the compiler during the preprocessing stage to tell you which khash lines in the original are the source of the leak.
As for your program in particular, I have not analyzed it carefully but do see one kh_destroy() call and that is usually all that is needed, one of those for each khash_init() line.  Use the method described above though to see if there is some other kind of leak.  For instance, it is common to use strdup() to make a copy of the key stored by khash and later freed by khash_destroy().  But you still have to free the original of the key elsewhere, outside of khash.

You have never freed cl1 and cl2. These are two leaks. In fact, you don't need to allocate for the two pointers. The better way is:
khint_t k;
k = kh_put(type, h, 55, &absent);
if (absent) {
  myval_t *cl1 = &kh_val(h, k);
  cl1->id = 55;
  cl1->len = 3;
  cl1->stream = strdup("abc");
}

@attractivechaos Thank you very much for pointing out that mallocing is not needed.
So I suppose I have two possibilities for what I want to do. (Both options do not leak mem accordingly to valgrind)
1. Initialise KHASH_MAP with struct (no mallocing needed)
#include "khash.h"
typedef struct {
	int id;
	char *stream;
	int len;
} myval_t;

int type = 0;
KHASH_MAP_INIT_INT(type, myval_t) //**<-- Struct!**
int main(void) {
	khash_t(type) *h;
	khint_t k;
	int absent;
	h = kh_init(type);
	myval_t *clx;

	//create struct1 and add it to hashtable
	k = kh_put(type, h, 55, &absent);
	if (absent) {
		myval_t *cl1 = &kh_val(h, k);
		cl1->id = 55;
		cl1->len = 3;
		cl1->stream = strdup("abc");
	}

	printf("\nremove all indexes and free malloced space\n");
	//remove all and free before
	for (k = kh_begin(h); k != kh_end(h); ++k){
		if (kh_exist(h, k)){
			free(kh_val(h,k).stream); //freeing malloced char within structure
		}
	}
	kh_destroy(type, h);
	return 0;
}

2. Initialize KHASH_MAP with struct pointer with mallocing and freeing
#include "khash.h"
typedef struct {
	int id;
	char *stream;
	int len;
} myval_t;

int type = 0;
KHASH_MAP_INIT_INT(type, myval_t*)// **<-- Struct Pointer!**
int main(void) {
	khash_t(type) *h;
	khint_t k;
	int absent;
	h = kh_init(type);
	myval_t *clx;

	//create struct1 and add it to hashtable
	myval_t *cl1 = malloc(sizeof(myval_t));
	cl1->id = 55;
	cl1->len = 3;
	cl1->stream = strdup("abc");
	k = kh_put(type, h, cl1->id, &absent);
	if(absent){
		kh_val(h, k) = cl1;
	}

	printf("\nremove all indexes and free malloced space\n");
	//remove all and free before
	for (k = kh_begin(h); k != kh_end(h); ++k){
		if (kh_exist(h, k)){
			free(kh_val(h,k)->stream); //freeing malloced char within structure
			free(kh_value(h, k)); //freeing malloced myval_t structures
		}
	}

	kh_destroy(type, h);
	return 0;
}

--> Any disadvantages in using the one or the other regarding for example performance, ... ?
Then another topic. I would like to setup a Khash with Klists. I was not able to do this directly. Instead I succeeded in creating a Khash with structs containing one Klists like the following:
#include "khash.h"
#include <stdio.h>
#include "klist.h"

//Klist contains only integers
#define __int_free(x)
KLIST_INIT(32, int, __int_free)

//KHash contains structs which contain one Klist
typedef struct {
	int len;
	klist_t(32) *kl;
} myval_t;
KHASH_MAP_INIT_STR(chash, myval_t*)

int main(void) {
	//create khash
	khash_t(chash) *h;
	khint_t k;
	int absent;
	h = kh_init(chash);

	//create struct1 with klist1 and add it to khash with key "list1"
	myval_t *cl1 = malloc(sizeof(myval_t));
	cl1->len = 3;
	cl1->kl = kl_init(32);
	*kl_pushp(32, cl1->kl) = 1;
	*kl_pushp(32, cl1->kl) = 2;
	*kl_pushp(32, cl1->kl) = 3;

	k = kh_put(chash, h, "list1", &absent);
	if(absent){
		kh_val(h, k) = cl1;
	}

	//create struct2 with klist2 and add it to khash with key "list2"
	myval_t *cl2 = malloc(sizeof(myval_t));
	cl2->len = 3;
	cl2->kl = kl_init(32);
	*kl_pushp(32, cl2->kl) = 5;
	*kl_pushp(32, cl2->kl) = 6;
	*kl_pushp(32, cl2->kl) = 7;
	k = kh_put(chash, h, "list2", &absent);
	if(absent){
		kh_val(h, k) = cl2;
	}

	//get klist of khash entry with key "list1"
	k = kh_get(chash, h, "list1");
	if (k != kh_end(h)){
		printf("%s\n", kh_key(h,k));
		kliter_t(32) *p;
		for (p = kl_begin(kh_val(h,k)->kl); p != kl_end(kh_val(h,k)->kl); p = kl_next(p)){
			printf("%d\n", kl_val(p));
		}
	}

	//get klists of all khash keys
	for (k = kh_begin(h); k != kh_end(h); ++k){
		if (kh_exist(h, k)){
			printf("%s\n", kh_key(h,k));
			kliter_t(32) *p;
			for (p = kl_begin(kh_val(h,k)->kl); p != kl_end(kh_val(h,k)->kl); p = kl_next(p)){
				printf("%d\n", kl_val(p));
			}

		}
	}

	//remove all klists and its structures and free before
	for (k = kh_begin(h); k != kh_end(h); ++k){
		if (kh_exist(h, k)){
			//destroy klist of each khash key
			kl_destroy(32, kh_val(h,k)->kl);
			//free the struct containing the klist
			free(kh_value(h, k));
		}
	}

	//free khash
	kh_destroy(chash, h);
	return 0;
}

--> This is also leak free accordingly to valgrind. But as you can see in the code, its using a struct to store the klists. How can I add klists to khashes directly without using structs?

Snap


vehicle_odometry: add timestamp_sample field for latency monitoring

Describe problem solved by this pull request
Currently, there is no straightforward way to track odometry measurement latencies since the delay isn't captured anywhere
Describe your solution
By adding a timestamp_sample field to vehicle_odometry and using it accordingly (timestamp - timestamp_sample), we get the latency tracking capabilities.
Test data / coverage

https://logs.px4.io/plot_app?log=5f50dfcc-8da2-42ea-b3da-53c5930cd6cd

Thanks @mhkabir. This is a good step towards pushing the actual timestamps into uORB as publication metadata. https://github.com/PX4/Firmware/pull/13970


get transforms to post if params given

What Ruby, Rails and RSpec versions are you using?
 I suggest you to check with them.
GET requests semantically do not include body, and as: implies you're setting body's content type.
Do you mean to say "request JSON results"?

Hello
Did you tried with the parameter as a hash?
# frozen_string_literal: true

require "bundler/inline"

gemfile(true) do
  source "https://rubygems.org"

  git_source(:github) { |repo| "https://github.com/#{repo}.git" }

  # Activate the gem you are reporting the issue against.
  gem "rails", "6.1.0"
  gem "rspec-rails"
end

require "rspec-rails"
require "action_controller/railtie"

class TestApp < Rails::Application
  config.root = __dir__
  config.hosts << "example.org"
  config.session_store :cookie_store, key: "cookie_store_key"
  secrets.secret_key_base = "secret_key_base"

  config.logger = Logger.new($stdout)
  Rails.logger  = config.logger

  routes.draw do
    get "/" => "test#index"
  end
end

class TestController < ActionController::Base
  include Rails.application.routes.url_helpers

  def index
    render plain: "Param : #{params["test"]}"
  end
end

require 'rspec/autorun'

RSpec.describe 'additions', type: :request do
  include Rack::Test::Methods

  let(:valid_headers) { { "Authorization" => "foo" } }

  it do
    get "/",
      { "test" => "Foo" },
      headers: valid_headers,
      as: :json
    expect(last_response.body).to include("Param : Foo")
  end

  private

  def app
    Rails.application
  end
end

I was able to reproduce the issue with an identical code. What @pirj was saying is defined in here.
I tried @benoittgt's script and it worked. However, I couldn't get my test passing.
After checking line by line, I finally found it. Somehow this line include Rack::Test::Methods fixes my test case:
RSpec.describe "/movies", type: :request do
  include Rack::Test::Methods

  describe "GET /index" do
    it "returns the last page only" do
      Movie.create!(title: "Ignored Movie")
      batman_movie = Movie.create!(title: "Batman")
      get movies_url, params: {page: {size: 1, number: 2}}, as: :json
      movies = JSON.parse(response.body)["movies"]
      expect(movies.size).to eq 1
      expect(movies.last.title).to eq batman_movie.title
    end
  end
end

I'm running rspec main:
  %w[rspec-core rspec-expectations rspec-mocks rspec-rails rspec-support].each do |lib|
    gem lib, git: "https://github.com/rspec/#{lib}.git", branch: "main"
  end

Here's my locked version:
GIT
  remote: https://github.com/rspec/rspec-core.git
  revision: 71823ba11ec17a73b25bdc24ebab195494c270dc
  branch: main
  specs:
    rspec-core (3.12.0.pre)
      rspec-support (= 3.12.0.pre)

GIT
  remote: https://github.com/rspec/rspec-expectations.git
  revision: 311aaf245f2c5493572bf683b8c441cb5f7e44c8
  branch: main
  specs:
    rspec-expectations (3.12.0.pre)
      diff-lcs (>= 1.2.0, < 2.0)
      rspec-support (= 3.12.0.pre)

GIT
  remote: https://github.com/rspec/rspec-mocks.git
  revision: 2c70bfbb5bc0f59525032615c8fa989dd1ade243
  branch: main
  specs:
    rspec-mocks (3.12.0.pre)
      diff-lcs (>= 1.2.0, < 2.0)
      rspec-support (= 3.12.0.pre)

GIT
  remote: https://github.com/rspec/rspec-rails.git
  revision: 6b4969ef8e20cbd21c51840c158b91f90630041c
  branch: main
  specs:
    rspec-rails (6.0.0.pre)
      actionpack (>= 6.1)
      activesupport (>= 6.1)
      railties (>= 6.1)
      rspec-core (= 3.12.0.pre)
      rspec-expectations (= 3.12.0.pre)
      rspec-mocks (= 3.12.0.pre)
      rspec-support (= 3.12.0.pre)

GIT
  remote: https://github.com/rspec/rspec-support.git
  revision: 5d653dfd130d45a742ab2300662b624e191f76a0
  branch: main
  specs:
    rspec-support (3.12.0.pre)

I don't think it's a bug anymore. The explanation is here: https://github.com/rails/rails/commit/af1680f51c127c7e40019e68c01b2a693ba2640f. I think it could be more visible somehow. Anyways, after deleting the explicit as: :json everything is back to normal.

Closing as this seems the intended behaviour on Rails end.


FHIRPath CLI

Is your feature request related to a problem? Please describe.
Currently, java project can use our fhirpath implementation by

including a dependency like this:

<dependency>
    <groupId>com.ibm.fhir:fhir-path</groupId>
    <artifactId>fhir-path</artifactId>
    <version>4.3.0</version>
</dependency>

and
2. writing code like this:
FHIRPathEvaluator.evaluator().evaluate(resource, fhirpath);

This works ok, but I think would be cool to build an all-in-one shaded cli jar for our fhirpath module so that we can execute this more easily from the command line:
java -jar fhir-path-$VERSION.jar resource fhirpath

Describe the solution you'd like
Introduce a main that takes arguments for the resource content and the fhirpath string to execute.
Ideally, we could pass resource content from

a file
a string (raw command line arg); or
stdin (so we can pipe to it)

One convention I've seen used is to interpret - as an indicator that we should read from stdin instead of a string or file, but I'm not tied to that.
Look at the fhir-persistence-schema and fhir-swagger-generator projects for examples on how to create the shaded all-in-one jar.
Describe alternatives you've considered
The alternative is to let clients do this themselves or use a different fhirpath engine for simple command-line stuff (e.g. the node fhirpath module).
Additional context
Add any other context or screenshots about the feature request here.

It would also be nice to:

allow some way to pass jar files to extend the registry for fhirpath operations like memberOf; and
provide some way to see supplemental issues that were generated during the evaluation, maybe by printing those to System.error by default (with an option to suppress that)

Would like to try out this issue @lmsurpre

@erodrago please go right ahead.  if you have any questions, come find us on Zulip. https://chat.fhir.org/#narrow/stream/212434-ibm

Alright thanks @prb112

PR https://github.com/IBM/FHIR/pull/2130


Updates for 0.12

@paf31 @MonoidMusician I've removed the Alternative instance for the Semiring version for now, as it is a valid Plus and it is a valid Applicative, it's just the interaction doesn't result in an Alternative. Seems a little dodgy still, but perhaps better than nothing until we come up with an alternative formulation.

until we come up with an alternative formulation.


More Minecraft remnants

As of 1.0.20, Schema contains registerEntities and registerBlockEntities methods, and registerTypes contains entityTypes and blockEntityTypes parameters.

This is still an issue: https://github.com/Mojang/DataFixerUpper/blob/41d097a3a2345588125bfef8231e962d51ec6ace/src/main/java/com/mojang/datafixers/schemas/Schema.java#L122-L128

https://github.com/Mojang/DataFixerUpper/blob/d58bfd5d4e47a7abf70dc606eb4c0754b5a04273/src/main/java/com/mojang/datafixers/schemas/Schema.java#L122-L128


find a way to block breaking changes from landing in release-23.x

we had to switch release-23.x from being a semantic-release "maintenance" branch to a "release" branch (see https://github.com/openedx/paragon/pull/3345 for details)
we should find a way to ensure we don't accidentally land commits that trigger a breaking change semantic release

investigate releaseRules
example
"releaseRules": [
          { "type": "breaking", "release": false }
        ]
      }

semantic-release-commit-analyzer plugin


Add tests for fsPromises.link

I found that there are no tests for fs.promises version of mkdir method.
The new tests can be identical to fs.link version:

should be a function
should create a link to an existing file
should create hard link to identical data node
should not follow symbolic links
should not allow links to a directory

I would not be implementing the tests for checking return type as issue #421 exists
I would like to take this issue and work on it if possible. (although I just finished it)

Great, it's all yours @Dragomegak


test: auto discover test cases from path

This PR enables the rest of basic_test.slt and a part of select.slt (#350) tests.
This also resolves #338: automatically discover test cases from path, by generating source file in build.rs.
Note that there is a test statistics.slt that fails on in-memory storage, it has been added to the blocklist in build.rs.

I have changed the ignore pattern from *.slt.0 to _*.slt.
Please take a look @skyzh


React Snippets not Loading

The snippets for react-js aren't loading but the normal javascript snippets are.  The filetype of my react files are "javascript.jsx" if that helps. Is there a way I can fix this?

If I open a test.jsx file, I get react snippets. Can you provide a minimal config to reproduce ?

How do I get the react snippets to load in .js files? They work fine in .jsx files and thank you for this plugin.

@pelachile
Note my config is setup for nvim v0.7.0  and use nvim-cmp with luasnip
I was able to get the react snippets in base .js files by adding the following line in my config

If this issue still persists feel free to reopen the issue and we will revisit it, but for now I am closing the issue :smile:


[STAC-3989] Remove Datadog mentions in config file

What does this PR do?

Remove Datadog mentions in config file
Applies branding to config templates
A brief description of the change being made with this pull request.

Motivation
What inspired you to submit this pull request?
Additional Notes
Anything else we should know when reviewing?

hm build_win pipeline is failing?


Create "Reviewed" Status for Cases

As of now there are over 2000 cases in our system, relying on the crowd to control what happens. If someone enters a case that is not in line with EBWiki's guidelines (which still need explaining),we'll have to remove that and explain the reasons why. Conversely, we need to distinguish between the cases that do merit its worth and those that don't.
We need to spend some time sorting these out.

I think this is a good idea. Agree we need to figure out exactly how the review process works and who is qualified to grant or revoke that status.


trying to fix travis failed test

Guys, i am trying to fix this issue beforehand. The other issues will be handled after that.
thanks for your patience

it is working now!

cc @cunneen


schema: Modify annotations to be a list of name/value pairs.

Change annotations from a map to a list of Annotation objects that represent name/values in the same manner as Labels. This maintains consistency with similar types and has the benefits already discussed in issues 58, 62, and 64. Namely,1) it maintains that field names on the left are schema, values on the right are user values 2) behavior during duplicate JSON object field names are not part of the JSON spec and may be handled differently based on the library being used...but generally an ill-formed manifest will have the duplicate error swallowed during JSON parsing.
Small fixup for isolator in SPEC.md example using "value" instead of "val"

awesome, thank you. @philips can you ack this?

ack, lgtm

I am going to merge this but it seems like val is one of the only abbreviations we have in the schema.

I am going to merge this but it seems like val is one of the only abbreviations we have in the schema.

@philips are you implying we should just change it to "value" everywhere?

I feel it should be. It is odd to have one unnecessary abbreviation.


Updated Custom Navigators Blog Link

Updated the link to the custom navigators doc in the blog post.

thanks!


"Don't Get Tricked!" screens are displaying incorrect instructions

Observed
"Don't Get Tricked!" screen shows "Pick the most popular trick answer for a bonus (+25)"
Screenshot on iPhone X:

Expected
"Don't Get Tricked!" screen shows "Pick the correct answer
to get for your team (+25)"
Screenshot from Figma (link):

I think the build is #29

Actually, related to https://github.com/rightoneducation/righton-app/pull/36 changes

Yong Lin and I verified that the correct message now appears -- great! A minor item: at least on an Android device (Galaxy S7), the text and button appear slightly misaligned (e.g., compare the attached screenshot with the Figma). If this can be fixed with a relatively quick adjustment, great; if not (and especially if this might be a display hiccup unique to older devices), no worries -- we can defer to later.


Better permissions handling for cameraOnly mode

@arok i've been reading about taking a picture in Android again.
So the thing is we should add WRITE_EXTERNAL_STORAGE permission to our app if the save path is public or our sdk is 18 and lower.
Could you please make it smarter where the WRITE_EXTERNAL_STORAGE only requested on that certain condition?
Thanks!

LGTM, will update some of the code after the merge. Thank you for your contribution


Issue with Validtor

Has anyone used this validator, we tested it and we see some of required the JSON entities names are not validated against correct schema entities name
Eg : Billing_code_type(schema naming ) is not validated to BillingCodeType(incorrect naming) , even if we remove this whole element from the output JSON , the validator says Valid JSON .

So far it seems to be working for us.  I have used the validator tool on a subset of our data for the In Network rates to catch issues before creating the entire file.
It caught:
1)Had JSON entity name "expriration_date" instead of "expiration_date"  gave error that "expiration_date" was missing.
2) Service Code: Single digit service codes (i.e. 1 - 9) were not padded with a zero - gave error that invalid values were included. 3) Had JSON entity name of "reporting_type" instead of reporting_entity_type - gave error message that "reporting_entity_type" was missing.
I could not reproduce your issue.  I took a valid JSON file & did a global replace to make "billing_code_type" be "billingcodetype" - it said the file was invalid said "billing_code_type" was missing.
FYI - We are using provider references and the subset of data I was using has ~ 900 "In Network Objects" and represents ~37,000 negotiated rates.

Closing issue due to inactivity.


cookies and localstorage as options

Hi,
Currently this module is using localstorage to save user preference. That's cool, but we cannot use it across subdomains.
Could you please add cookies as alternative storage solution that works across subdomains?
Thank you

Hi,
Currently this module is using localstorage to save user preference. That's cool, but we cannot use it across subdomains.
Could you please add cookies as alternative storage solution that works across subdomains?
Thank you

Hi
I try to add options for sync location storage with cookie
I think this change will resolve this issue
#188

Any progress with this?

latest version implements this feature. Sadly no control over cookie path, domain etc


Create dissemination attendee form

Refer
https://github.com/Scaler-Community-Projects/NGO-Farmer-Analysis/wiki/Dissemination-Form
We need to implement the part 2 of this document - attendee/farmer details.

I want to work on this

Please suggest for any changes in this form regarding layout / input types or anything else that needs to be corrected?

Nice work.
Few suggestions:

You can use radio buttons for Adoption wish
Questions asked by farmer can be a textarea


*browser.py: allow raising LinkNotFound on 404 error

Ported from chamilotools (new tests added).

Should be ready to merge now (Travis fails on pypy3 because of an issue on Travis's side, but not on ours)


Go CLI: rule-get should return yaml by default

a8ctl-beta rule-get is returning JSON by default instead of YAML. The default when -o is not specified should be YAML. For JSON output the -o json must be set.

Implemented https://github.com/amalgam8/amalgam8/pull/433/commits/e70ffe805fc69598371dff7c1742d4780689cc0c


Ability to move blocks within dashboard?

Wouldn't it be nice to move blocks within dashboards? We can use html5 localStorage to store the state. The UI is very neat and clean, and I think this would be a good feature to add.

It would be nice yes, however I personally feel it would add bloat to the project as it's a feature that isn't needed by all.
I'll have a look to see if there is any clean solutions to doing it though.

Its a tricky thing - between bloating and whether its a necessary feature. While I agree that in a general scenario, the ability to move blocks only adds aesthetic value, but the feature is almost symbolic when you think of any dashboard, which makes it really good to have, imo.


MS Edge Browser Flags This Github as UNSAFE

This has been happening for some weeks now. BRIGHT RED Page, with the following message:
This site has been reported as unsafe
Hosted by github.com
Microsoft recommends you don't continue to this site. It has been reported to Microsoft for containing harmful programs that may try to steal personal or financial information.
 If you visit a malicious site, malware could infect your device automatically. You might also be putting your sensitive information—like passwords, credit card numbers, contact info, or software activation keys—at risk. Learn more
Malicious sites often use spam emails, advertisements, or redirections from other sites to trick you into downloading malicious software. Sometimes, a trusted site may be hacked by bad actors and used to link to malicious content. If in doubt, go back.
Report that this site doesn’t contain malware threats
Continue to the unsafe site (not recommended)
Microsoft Defender SmartScreen

I forgot that I had mentioned the Microsoft UNSAFE flag in the comments of another ticket! He mentioned this wiki: [https://github.com/T-Troll/alienfx-tools/wiki/Why-antivirus-complain-about-some-alienfx-tools-components%3F]
Closing this ticket


requestAnimationFrame for better performance?

Why is setTimeout instead of requestAnimationFrame used for the throttleing? I know this has been reported before
https://github.com/cferdinandi/smooth-scroll/issues/224
But there's a really simple polyfill here https://gist.github.com/paulirish/1579671

Thanks for doing your homework, and for locating the polyfill.
In addition to more backwards compatibility, I just haven't wanted to rewrite that section of the script when it works "good enough" already.


vite-plugin-kit-routes doesn´t handle groups properly

Describe the bug
When using routing groups (group) vite-plugin-kit-routes doesn´t handle them properly. Let's take my example : (assets)/site.webmanifest
The given key is fine : assets_site.webmanifest but what is returned is wrong : /(assets)/site.webmanifest
As the group is only used by SvelteKit and is not served, the returned path should be : /site.webmanifest
Your Example Website or App
https://github.com/xKesvaL/kesval.com/tree/refactor
Steps to Reproduce the Bug or Issue

Create a new sveltekit project
Add a grouping folder
Add a page in this folder
See the routes.ts file bug

Expected behavior
I expected to have the path be returned without the group.
Screenshots or Videos
No response
Platform

OS: Linux
NodeJS: 20.9.0
<EMAIL_ADDRESS>
Additional context
No response

Thx for the report, @all-contributors please add @xKesvaL for detailed report.
I'll fix it in coming hours 👍

Should be fixed in<EMAIL_ADDRESS>please re open if needed.

IMO the key should include the (group) part so that RequestEvent.route.id values can be used as valid keys for the route() function

My use case is as follows:
I have a tab list in +layout.svelte and need to know which tab is currently active. I was hoping to do something like the following:
<script lang="ts">
    import {LayoutRouteId} from "./$types"
    const tabs: Array<{label: string; routeId: LayoutRouteId}> = [...]
</script>

{#each tabs as tab}
    {@const isActive = tab.routeId === $page.route.id}
    {@const link = route(tab.routeId)}

I know this is a very niche use-case and isn't a deal-breaker, of course. Though it would be nice if the keys were consistent with route.id

I understand,
Is this example flying until the end ?
Here LayoutRouteId contains what ? Multiple ids of all routes under ? What do you do with params ?
Could you do a repro ?

Yes LayoutRouteId type exported from autogenerated ./$types file is a string literal type which includes route IDs for all routes in the given layout. I have updated the example in my previous comment. Lmk if a full repro is required


Fix many golint errors

Partially resolves #81. I will be building another PR to finish it off tomorrow.

@erikh thanks for taking care of this. The changes LGTM except for a few minor comments. Also the sanity seems to be failing may be there is some problem with the trunk itself, I will try running it locally and see if I can find anything as well.

This is probably #83, I will rebase this after merge + fixing the interface issue, then we can revisit this patch.
-Erik

On May 26, 2015, at 10:31 AM, Madhav Puri<EMAIL_ADDRESS>wrote:
@erikh https://github.com/erikh thanks for taking care of this. The changes LGTM except for a few minor comments. Also the sanity seems to be failing may be there is some problem with the trunk itself, I will try running it locally and see if I can find anything as well.
—
Reply to this email directly or view it on GitHub https://github.com/contiv/netplugin/pull/82#issuecomment-105612850.

This should be ready for another pass after the tests pass.

LGTM, can merge once the test pass!


Corrected questions

Fixed all of the errors mentioned in #6 .
Wasn't familiar with the "qid" parameter and how its optained so its just an empty string for now.

Appreciate the corrections.
This means a lot :)


Feature/accessible gifffer

#15

if data-gifffer-alt provided, appends a p tag with the visually hidden alt description to provide an alternative image description for screen reader users.

hide the container from screen reader users with aria-hidden (since it is a button now, that might confuse them since the screen reader would read ', button' without any context making it difficult to understand what it does)

Thanks.1.3.0 version released.