sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: rust
Issue: Nested argument mismatch could suggest moving extra parameter outside parenthesis
Labels: A-diagnostics,T-compiler

### Code

[playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=c7df082d83e5903e442fb42db8bccbea)

```Rust
fn mul(a: i32, b: i32) -> i32 {
    a * b
}

fn main() {
    let x = mul(4.min(3, 14));
    println!("{x}");
}
```


### Current output

```Shell
Compiling playground v0.0.1 (/playground)
error[E0061]: this method takes 1 argument but 2 arguments were supplied
   --> src/main.rs:6:19
    |
6   |     let x = mul(4.min(3, 14));
    |                   ^^^  ----
    |                        | |
    |                        | unexpected argument of type `{integer}`
    |                        help: remove the extra argument
    |
note: method defined here
   --> /playground/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/cmp.rs:877:8
    |
877 |     fn min(self, other: Self) -> Self
    |        ^^^

error[E0061]: this function takes 2 arguments but 1 argument was supplied
 --> src/main.rs:6:13
  |
6 |     let x = mul(4.min(3, 14));
  |             ^^^-------------- an argument of type `i32` is missing
  |
note: function defined here
 --> src/main.rs:1:4
  |
1 | fn mul(a: i32, b: i32) -> i32 {
  |    ^^^ ------  ------
help: provide the argument
  |
6 |     let x = mul(4.min(3, 14), /* i32 */);
  |                ~~~~~~~~~~~~~~~~~~~~~~~~~

For more information about this error, try `rustc --explain E0061`.
error: could not compile `playground` (bin "playground") due to 2 previous errors
```


### Desired output

Something like
```Shell
6   |     let x = mul(4.min(3), 14);
    |                   ^^^  ~~~~~
    |                        |
    |                        |
    |                        help: move the argument outside the parenthesis
```


### Rationale and extra context

This happened while trying to pass a missing parameter to an outer function, but I had placed the extra parameter to a call inside instead. When both of the conditions are met, we can be mostly sure that the user intended to pass the parameter to the outer function instead:
* The inner function/method expects at least one argument and the user passed in an extra one
* The function call is the last passed in argument to the outer function, but outer function expects one additional argument.
* The type matches (not sure if possible to check that, but that would make it 100% sure that this is what the user intended)

### Other cases

_No response_

### Rust Version

```Shell
Latest nightly
```


### Anything else?

<!-- TRIAGEBOT_START -->

<!-- TRIAGEBOT_ASSIGN_START -->

<!-- TRIAGEBOT_ASSIGN_DATA_START$${"user":"long-long-float"}$$TRIAGEBOT_ASSIGN_DATA_END -->

<!-- TRIAGEBOT_ASSIGN_END -->
<!-- TRIAGEBOT_END -->
Repository: ollama
Issue: Importing a Mistral finetune into Ollama fails with `invalid file magic`
Labels: bug

### What is the issue?

Importing a custom Mistral-7B finetune into Ollama from safetensors fails with `invalid file magic`. Converting the same safetensors to gguf with llama.cpp works on import.

Steps to reproduce:
- Finetune Mistral with MLX, fuse the lora to the model to get the resulting safetensors.
- Create the modelfile:
```
FROM ./model
TEMPLATE """
 {{ .System }} {{ .Prompt }} 
"""
PARAMETER stop "
"
PARAMETER stop "
"
```
- Import the model
```
❯ ollama create my-finetune -f ~/models/my-finetune/Modelfile
transferring model data 
unpacking model metadata 
processing tensors 
creating model layer 
Error: invalid file magic
```

This Modelfile works, after converting the safetensors with llama.cpp:
```
FROM ./ggml-model-Q4_K_M.gguf
TEMPLATE """
 {{ .System }} {{ .Prompt }} 
"""
PARAMETER stop "
"
PARAMETER stop "
"
```

### OS

macOS

### GPU

_No response_

### CPU

_No response_

### Ollama version

0.1.33
Repository: java-design-patterns
Issue: Service-Oriented Architecture pattern
Labels: info: help wanted,epic: pattern,type: feature,Stale

Introduce the Service-Oriented Architecture (SOA) pattern to enhance modular service interaction.

Service-Oriented Architecture (SOA) is a design pattern where services are provided to other components by application components, through a communication protocol over a network. Here are the main points to consider when implementing SOA:

1. **Loose Coupling**: Services should be designed in such a way that they can operate independently without knowledge of the definitions of other services. This allows for easier maintenance and scalability.

2. **Service Abstraction**: Services hide the logic behind the service interface and only expose operations that are useful to the service consumer. This keeps the complexity of the system hidden from the end user.

3. **Service Reusability**: Services are designed to be reused for different purposes across different parts of an application or even across different applications. This maximizes the usefulness of a service and reduces redundancy.

4. **Interoperability**: Services must be designed to operate with other services in different systems or architectural frameworks, typically using standard protocols and formats.

5. **Scalability**: SOA allows for services to be scaled independently, so that the system can respond to increasing loads by scaling only the necessary components.

6. **Statelessness**: Services ideally should not maintain a state but should handle every request as an independent transaction, which can be scaled and recovered, thereby increasing reliability.

7. **Discoverability**: Services should be designed so that they can be discovered through standard mechanisms, which makes it easy to find and bind to these services in a distributed network.

8. **Security**: Since services are exposed over a network, implementing robust security measures to secure communication and data access is essential.

Implementing SOA typically involves setting up a service registry, defining service interfaces, ensuring security protocols are in place, and creating middleware that can handle service communication efficiently. Each service functions as a discrete unit of functionality that can be updated independently without impacting other components, facilitating a flexible, adaptable software environment.

Acceptance Criteria:

- Implementation follows the guidelines given above.
- Implementation follows the contributions instructions at https://github.com/iluwatar/java-design-patterns/wiki/01.-How-to-contribute
Repository: vscode
Issue: Directory Profiles Associations
Labels: feature-request,user-profiles

<!-- ⚠️⚠️ Do Not Delete This! feature_request_template ⚠️⚠️ -->
<!-- Please read our Rules of Conduct: https://opensource.microsoft.com/codeofconduct/ -->
<!-- Please search existing issues to avoid creating duplicates. -->

<!-- Describe the feature you'd like. -->

Although profiles have [Workspace associations](https://code.visualstudio.com/docs/editor/profiles#_workspace-associations), a non-default profile needs to be selected. I would love to see it conditionally and automatically happening when launching `code` from a workspace (something in the spirit of [Git conditional includes](https://git-scm.com/docs/git-config#_conditional_includes).

For instance, assume `org1` and `org2` profiles have been created and there are directories named `org1` and `org2` nested within a `projects` directory. When executing `code .` (without any arguments) within `org1` directory (or within any nested directory), then `code` will launch with the `org1` profile (equivalent for executing `code --profile org1 .`).

This could be easily done by wrapping `code` with a simple script such as

```shell
#!/usr/bin/env bash
PROFILE="Default"
! [ "$PWD" = "${PWD#${HOME}/projects/org1}" ] && PROFILE=org1
! [ "$PWD" = "${PWD#${HOME}/projects/org2}" ] && PROFILE=org2
code --profile "$PROFILE" "@$"
```

But it would be lovely to not wrap `code` and have it configured in the/a settings/file respectively.
Repository: next.js
Issue: Next App Router (14.2.3) - Inconsistent Singleton
Labels: bug,Module Resolution

### Link to the code that reproduces this issue

https://github.com/vaneenige/next-app-router-singleton

### To Reproduce

1. Install dependencies
2. Run the build - `npm run build`
3. See the log of `Create random` multiple times

### Current vs. Expected behavior

Current behavior: 
- We are rendering 100 pages that all use a singleton module.
- During the build it logs the initialization multiple times (~5)

Expected behavior:
- It should run the initialization **once** 
- It's also odd that it doesn't run it 100 times, but rather just a few times.

In the reproduction repository you can find a few different test cases:
- With a class that is initialized
- With the globalThis (check and override)
- With the React.cache (async) function

---

After quite a bit of research I found multiple sources claiming that this pattern does work with the `pages` directory, but also multiple sources that can't get it to work with the `app` directory.

- Using the `globalThis` method in `pages`: https://github.com/vercel/next.js/discussions/15054#discussioncomment-658138
- Multiple users having issues with it in `app`: https://github.com/vercel/next.js/discussions/48481#discussioncomment-5686272
- Shiki (syntax highlighter) causing memory issues (the solution is in the reproduction, but doesn't behave as expected): https://github.com/shikijs/shiki/issues/567
- Prisma suggesting the `globalThis` solution to prevent too many connections: https://www.prisma.io/docs/orm/more/help-and-troubleshooting/help-articles/nextjs-prisma-client-dev-practices 

---

Having a proper singleton could benefit a lot of use cases such as database connections or separate worker scripts.

I've seen the issue being discussed on Reddit and GitHub with regards to MongoDB (or other persistent API connections) too.

### Provide environment information

```bash
Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 23.0.0: Fri Sep 15 14:41:34 PDT 2023; root:xnu-10002.1.13~1/RELEASE_ARM64_T8103
  Available memory (MB): 16384
  Available CPU cores: 8
Binaries:
  Node: 18.17.1
  npm: 9.6.7
  Yarn: N/A
  pnpm: N/A
Relevant Packages:
  next: 14.2.3 // Latest available version is detected (14.2.3).
  eslint-config-next: 14.2.3
  react: 18.3.1
  react-dom: 18.3.1
  typescript: 5.4.5
Next.js Config:
  output: N/A
```


### Which area(s) are affected? (Select all that apply)

Module Resolution

### Which stage(s) are affected? (Select all that apply)

next build (local)

### Additional context

_No response_
Repository: tauri
Issue: [bug] Resources with `$` in their name make build step fail on Windows
Labels: type: bug,status: needs triage

### Describe the bug

I'm working on an app that utilizes JNI to call Java. In my Java class, I have inner classes that should be named OuterClass$InnerClass.class after compilation. However, these inner class files cannot be found during the build step. It appears that the $ symbol is being improperly escaped with another $, causing the build step to fail.

### Reproduction

1. Create a Next.js Tauri app using Next.js.
2. Add a resource with $ in its name to the tauri.conf.json.
3. Build the app.

### Expected behavior

The build step should finish with included resources.

### Full `tauri info` output

```text
[✔] Environment
    - OS: Windows 10.0.22621 X64
    ✔ WebView2: 124.0.2478.67
    ✔ MSVC: 
        - Visual Studio Community 2019
        - Visual Studio Community 2022
    ✔ rustc: 1.77.1 (7cf61ebde 2024-03-27)
    ✔ cargo: 1.77.1 (e52e36006 2024-03-26)
    ✔ rustup: 1.27.0 (bbb9276d2 2024-03-08)
    ✔ Rust toolchain: stable-x86_64-pc-windows-msvc (environment override by RUSTUP_TOOLCHAIN)
    - node: 20.12.0
    - pnpm: 8.15.6
    - npm: 10.5.0

[-] Packages
    - tauri [RUST]: 1.5.4
    - tauri-build [RUST]: 1.5.1
    - wry [RUST]: 0.24.7
    - tao [RUST]: 0.16.7
    - tauri-cli [RUST]: 1.5.11
    - @tauri-apps/api [NPM]: 1.5.3 (outdated, latest: 1.5.4)
    - @tauri-apps/cli [NPM]: 1.5.11 (outdated, latest: 1.5.12)

[-] App
    - build-type: bundle
    - CSP: unset
    - distDir: ../out
    - devPath: http://localhost:3000/
    - framework: React (Next.js)
    - bundler: Webpack
```


### Stack trace
The actual file is named `WebFXScan$CImageInfo.class`
```text
File: "C:\Users\enkhj\projects\pms-mirai-app\src-tauri\java\adview\webfxscan\WebFXScan$$CImageInfo.class" -> no files found.
Usage: File [/nonfatal] [/a] ([/r] [/x filespec [...]] filespec [...] |
   /oname=outfile one_file_only)
Error in script "C:\Users\enkhj\projects\pms-mirai-app\src-tauri\target\release\nsis\x64\installer.nsi" on line 563 -- aborting creation process
       Error failed to bundle project: `The system cannot find the file specified. (os error 2)`
```


### Additional context

It works fine on MacOS
Repository: flutter
Issue: Provide better information for "Some input files use or override a deprecated API"
Labels: platform-android,tool,t: gradle,P2,team-tool,triaged-tool

### Use case

Many Flutter apps that depend on plugins often output the following messages when building for Android:

```
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
```

But it's not obvious at all how to actually "Recompile with -Xlint:deprecation". Recently a person asked this question in #147414, and I was motivated to find [a solution](https://github.com/flutter/flutter/issues/147414#issuecomment-2080012991).

### Proposal

I suggest that flutter tool filters out all out these lines from its output:

```
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
```

But on the first occurence of such text, it prints a useful warning message, and suggest an action to take, e.g.:

```
Some Java sources use or override a deprecated API.
To see exactly what the offending files are, append the following to
/Users/bartek/projects/example/android/build.gradle:

  subprojects.forEach { project ->
      project.tasks.withType(JavaCompile) {
          options.compilerArgs += ['-Xlint:deprecation']
      }
  }

If these warnings come from a plugin, consult the plugin maintainer.
```

If the project uses Gradle Kotlin DSL instead of Gradle Groovy DSL, the warning message adapts:

```
Some Java sources use or override a deprecated API.
To see exactly what the offending files are, append the following to
/Users/bartek/projects/example/android/build.gradle.kts:

  subprojects.forEach { project ->
      project.tasks.withType<JavaCompile> {
          options.compilerArgs.addAll(listOf("-Xlint:deprecation"))
      }
  }

If these warnings come from a plugin, consult the plugin maintainer.
```
Repository: PowerToys
Issue: Quick Registry Search
Labels: Needs-Triage

### Description of the new feature / enhancement

Quick Registry Search
Can quickly search for system regedit records, the system's built-in regedit.exe is too slow

### Scenario when this would be used?

It is really necessary to quickly find stubborn registration items created by junk software, and quickly rule out any abnormal registration of Trojans

### Supporting information

_No response_
Repository: react
Issue: [React 19] prop-types removal alternative / console component trace
Labels: React 19

## Summary

The state of `.propTypes` is a bit unclear. I see:

1. https://react.dev/blog/2024/04/25/react-19 doesn't mention their deprecation but https://react.dev/blog/2024/04/25/react-19-upgrade-guide#removed-proptypes-and-defaultprops does. Should the two pages by synced?
2. https://react.dev/blog/2024/04/25/react-19-upgrade-guide#removed-proptypes-and-defaultprops says:
  <img width="455" alt="image" src="https://github.com/facebook/react/assets/3165635/1da94ce8-583d-4c34-bf5c-d358b1bb057f">

  But it looks inaccurate, I would expect it says that `React.PropTypes` were deprecated from the source linked.
  <img width="854" alt="SCR-20240504-buph" src="https://github.com/facebook/react/assets/3165635/eeac92b4-b210-43ec-87d1-6cb3c01a2a70">
  [Source](https://legacy.reactjs.org/blog/2017/04/07/react-v15.5.0.html#react)

3. The migration guides encourage to migrate to "TypeScript or another type-checking solution", but TypeScript has a limited type coverage. For instance, it doesn't support integers. We rely on this e.g. (not the most convincing example, though, you can check Material UI codebase to see other examples, like deprecated props, incompatible props combinations) 

```jsx
Autocomplete.propTypes = {
  /**
   * The maximum number of tags that will be visible when not focused.
   * Set `-1` to disable the limit.
   * @default -1
   */
  limitTags: integerPropType,
```

https://github.com/mui/material-ui/blob/2827bacf567fc95ef147d543316ffe688896db90/packages/mui-material/src/Autocomplete/Autocomplete.js#L985-L990

So to replace this, it seems that the closest alternative is to do something like this:

```jsx
function DemoComponent(props) {
  if (process.env.NODE_ENV !== "production") {
    if (typeof props.bar !== "string") {
      console.error(
        `Warning: Failed prop type: Invalid prop \`bar\` of type \`number\` supplied to \`DemoComponent\`, expected \`string\`.`
      );
    }
  }

  return null;
}
```

Unfortunately, it's missing the component trace.

Before: https://codesandbox.io/p/sandbox/mystifying-mcclintock-mf7r5m?file=%2Fsrc%2FDemo.js%3A16%2C1

<img width="538" alt="SCR-20240504-oepf" src="https://github.com/facebook/react/assets/3165635/64408083-e139-4eb5-a8b9-3e9430f69c03">

After: https://codesandbox.io/p/sandbox/agitated-orla-8kj8rh?file=%2Fsrc%2Findex.js

<img width="705" alt="SCR-20240504-oehu" src="https://github.com/facebook/react/assets/3165635/9ce5468a-af80-46e9-825d-e2aace61d2bb">

It seems much harder to figure out where console logs come from. So while https://react.dev/blog/2024/04/25/react-19#diffs-for-hydration-errors is a great step forward, this one feels like a step backward. Is there an alternative to it?

There is a function in https://github.com/facebook/prop-types/blob/1c9c6311c1fb8778bffc7a1ca70c273ee8a8654d/checkPropTypes.js#L20 but it doesn't log the component trace either. This function was recommended in #28328.
Repository: angular
Issue: Error Message for missing [ngModelOptions]="{standalone: true}" entry dont show line in code where it is missing
Labels: area: forms

### Which @angular/* package(s) are the source of the bug?

Don't known / other

### Is this a regression?

No

### Description

When using ngModel i get sometimes the error message:

ERROR Error: NG01352: If ngModel is used within a form tag, either the name attribute must be set or the form
    control must be defined as 'standalone' in ngModelOptions.

    Example 1: <input [(ngModel)]="person.firstName" name="first">
    Example 2: <input [(ngModel)]="person.firstName" [ngModelOptions]="{standalone: true}">
    at missingNameException (forms.mjs:3748:12)
    at NgModel._checkName (forms.mjs:4070:19)
    at NgModel._checkForErrors (forms.mjs:4053:14)
    at NgModel.ngOnChanges (forms.mjs:3980:14)
    at NgModel.rememberChangeHistoryAndInvokeOnChangesHook (core.mjs:4101:14)
    at callHookInternal (core.mjs:5136:14)
    at callHook (core.mjs:5167:9)
    at callHooks (core.mjs:5118:17)
    at executeInitAndCheckHooks (core.mjs:5068:9)
    at refreshView (core.mjs:12806:21)


In the error message is not written, on which part of the code (i.e. in which file and which line of code) the error occurs.



### Please provide a link to a minimal reproduction of the bug

_No response_

### Please provide the exception or error you saw

```true
The error message should display in which file and which line of code the error occurs.
```


### Please provide the environment you discovered this bug in (run `ng version`)

```true
Angular CLI: 17.3.3
Node: 20.11.0
Package Manager: npm 10.2.4
OS: win32 x64

Angular: 17.3.3
... animations, cdk, cli, common, compiler, compiler-cli, core
... forms, material, material-luxon-adapter, platform-browser
... platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1703.3
@angular-devkit/build-angular   17.3.3
@angular-devkit/core            17.3.3
@angular-devkit/schematics      17.3.3
@angular/flex-layout            15.0.0-beta.42
@schematics/angular             17.3.3
rxjs                            7.8.1
typescript                      5.4.4
zone.js                         0.14.4
```


### Anything else?

_No response_
Repository: electron
Issue: [Bug]: `fs.readdir` does not work correctly with files that contain umlauts
Labels: platform/windows,bug :beetle:,component/node-integration,status/confirmed,has-repro-repo,31-x-y

### Preflight Checklist

- [X] I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/main/CONTRIBUTING.md) for this project.
- [X] I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/main/CODE_OF_CONDUCT.md) that this project adheres to.
- [X] I have searched the [issue tracker](https://www.github.com/electron/electron/issues) for a bug report that matches the one I want to file, without success.

### Electron Version

31.0.0-alpha.3

### What operating system are you using?

Windows

### Operating System Version

Windows 11

### What arch are you using?

x64

### Last Known Working Electron version

_No response_

### Expected Behavior

I'm trying to read files from a directory using node's `fs.readdir` function. When there is a file with umlauts in the name, for example `äöü.txt` it should return `'äöü.txt'`.

### Actual Behavior

When using `fs.readdir` in an electron application it returns `'├ñ├╢├╝.txt'`. Invoking the same code from node (v20.12.2) works as expected.

### Testcase Gist URL

https://github.com/oliverschwendener/nodejs-readdir-test

### Additional Information

The provided GitHub repo has a guide on how to reproduce the issue.
Repository: ui
Issue: [bug]: block code is incomplete
Labels: bug

### Describe the bug

`Tooltip` must be used within `TooltipProvider`
![Screenshot (115)](https://github.com/shadcn-ui/ui/assets/78332454/0afc332a-1f82-462c-91be-6f17ea748b46)


### Affected component/components

Shadcn block is affected by it 

### How to reproduce

By adding `TooltipProvider` in code it'll solve the problem

### Codesandbox/StackBlitz link

_No response_

### Logs

_No response_

### System Info

```bash
window 10, brave
```


### Before submitting

- [X] I've made research efforts and searched the documentation
- [X] I've searched for existing issues