PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: JayBizzle/Crawler-Detect (php)

Issue:
Incorrect agent result
Just tested `Headless Chrome 131.0.6778.87 on GNU/Linux`, but does not recognize it

Pull request:
Better detecting of all `headless` browsers
Added `headless` as a general term to look at, since all headless browsers can (probably quite safely?) be described as crawlers. So then also removed the `HeadlessChrome` check specifically to avoid collisions.

Closes #556 

Patch:
diff --git a/src/Fixtures/Crawlers.php b/src/Fixtures/Crawlers.php
index c16b78d..ee6a2cf 100644
--- a/src/Fixtures/Crawlers.php
+++ b/src/Fixtures/Crawlers.php
@@ -534,7 +534,6 @@ class Crawlers extends AbstractProvider
         'Hatena',
         'Havij',
         'HaxerMen',
-        'HeadlessChrome',
         'HEADMasterSEO',
         'HeartRails_Capture',
         'help@dataminr\.com',
@@ -1435,6 +1434,6 @@ class Crawlers extends AbstractProvider
         'Zoom\.Mac',
         'ZoteroTranslationServer',
         'ZyBorg',
-        '[a-z0-9\-_]*(bot|crawl|archiver|transcoder|spider|uptime|validator|fetcher|cron|checker|reader|extractor|monitoring|analyzer|scraper)',
+        '[a-z0-9\-_]*(bot|crawl|headless|archiver|transcoder|spider|uptime|validator|fetcher|cron|checker|reader|extractor|monitoring|analyzer|scraper)',
     ];
 }


Test patch:
diff --git a/tests/data/user_agent/crawlers.txt b/tests/data/user_agent/crawlers.txt
index a019c75..ebdf9a8 100644
--- a/tests/data/user_agent/crawlers.txt
+++ b/tests/data/user_agent/crawlers.txt
@@ -6,6 +6,7 @@ CheckHost (http://check-host.net/)
 YandeG 1.03
 yacybot (/global; amd64 Linux 3.16-0.bpo.2-amd64; java 1.7.0_65; Europe/en) http://yacy.net/bot.html
 SEMrushBot
+Headless Chrome 131.0.6778.87 on GNU/Linux
 Protopage/3.0 (http://www.protopage.com)
 yacybot (/global; amd64 Linux 3.16.0-4-amd64; java 1.7.0_75; Europe/en) http://yacy.net/bot.html
 StatoolsBot (+http://www.statools.com/bot.html)
Repository: dprint/dprint-plugin-typescript (rust)

Issue:
useBraces=whenNotSingleLine adds braces when conditional spans multiple lines
**Describe the bug**

dprint-plugin-typescript version: 0.73.0

```
{
  "indentWidth": 4,
  "useBraces": "whenNotSingleLine",
  "singleBodyPosition": "maintain"
}
```

**Input Code**

```ts
if (someFunction({
    xyz: 1234
})) return;
```

**Expected Output**

```ts
if (
    someFunction({
        xyz: 1234,
    })
) return;
```

**Actual Output**

```ts
if (
    someFunction({
        xyz: 1234,
    })
) { return; }
```

Setting `"singleBodyPosition": "maintain"` fixes this. Probably similar in vein to #359.


Pull request:
fix: useBraces: whenNotSingleLine should not add braces when header end ln == statement end ln
Closes #416

Patch:
diff --git a/src/generation/generate.rs b/src/generation/generate.rs
index a582475..a34e0fe 100644
--- a/src/generation/generate.rs
+++ b/src/generation/generate.rs
@@ -8034,7 +8034,7 @@ fn gen_conditional_brace_body<'a>(opts: GenConditionalBraceBodyOptions<'a>, cont
             if force_braces {
               Some(true)
             } else {
-              let is_multiple_lines = condition_helpers::is_multiple_lines(condition_context, start_header_ln.unwrap_or(start_lc.line), end_ln)?;
+              let is_multiple_lines = condition_helpers::is_multiple_lines(condition_context, end_header_ln.unwrap_or(start_lc.line), end_ln)?;
               Some(is_multiple_lines)
             }
           }


Test patch:
diff --git a/tests/specs/issues/issue0416.txt b/tests/specs/issues/issue0416.txt
new file mode 100644
index 0000000..ada0af9
--- /dev/null
+++ b/tests/specs/issues/issue0416.txt
@@ -0,0 +1,24 @@
+~~ indentWidth: 4, useBraces: whenNotSingleLine, singleBodyPosition: maintain ~~
+== should not add braces ==
+if (someFunction({
+    xyz: 1234
+})) return;
+if (someFunction({
+    xyz: 1234
+})) {
+    return;
+}
+
+[expect]
+if (
+    someFunction({
+        xyz: 1234,
+    })
+) return;
+if (
+    someFunction({
+        xyz: 1234,
+    })
+) {
+    return;
+}
Repository: vaskoz/dailycodingproblem-go (go)

Issue:
Day 189
Good morning! Here's your coding interview problem for today.

This problem was asked by Google.

Given an array of elements, return the length of the longest subarray where all its elements are distinct.

For example, given the array `[5, 1, 3, 5, 2, 3, 4, 1]`, return `5` as the longest subarray of distinct elements is `[5, 2, 3, 4, 1]`.

Pull request:
Day189
Resolves #391.

Patch:
diff --git a/README.md b/README.md
index 007c4ff..8064228 100644
--- a/README.md
+++ b/README.md
@@ -199,3 +199,4 @@ problems from
 * [Day 186](https://github.com/vaskoz/dailycodingproblem-go/issues/382)
 * [Day 187](https://github.com/vaskoz/dailycodingproblem-go/issues/387)
 * [Day 188](https://github.com/vaskoz/dailycodingproblem-go/issues/388)
+* [Day 189](https://github.com/vaskoz/dailycodingproblem-go/issues/391)
diff --git a/day189/problem.go b/day189/problem.go
new file mode 100644
index 0000000..a317bc4
--- /dev/null
+++ b/day189/problem.go
@@ -0,0 +1,27 @@
+package day189
+
+// LengthLongestDistinct returns the length of the longest
+// sub-array where all elements are distinct.
+// Runs in O(N) time and O(N) extra space.
+func LengthLongestDistinct(nums []int) int {
+	valueToPos := make(map[int]int)
+	var longest int
+	for i, v := range nums {
+		if pos, found := valueToPos[v]; found {
+			if l := len(valueToPos); l > longest {
+				longest = l
+			}
+			for val, p := range valueToPos {
+				if p <= pos {
+					delete(valueToPos, val)
+				}
+			}
+		}
+		valueToPos[v] = i
+
+	}
+	if l := len(valueToPos); l > longest {
+		longest = l
+	}
+	return longest
+}


Test patch:
diff --git a/day189/problem_test.go b/day189/problem_test.go
new file mode 100644
index 0000000..9715df1
--- /dev/null
+++ b/day189/problem_test.go
@@ -0,0 +1,27 @@
+package day189
+
+import "testing"
+
+var testcases = []struct {
+	nums   []int
+	length int
+}{
+	{[]int{5, 1, 3, 5, 2, 3, 4, 1}, 5},
+}
+
+func TestLengthLongestDistinct(t *testing.T) {
+	t.Parallel()
+	for _, tc := range testcases {
+		if result := LengthLongestDistinct(tc.nums); result != tc.length {
+			t.Errorf("Expected %v, got %v", tc.length, result)
+		}
+	}
+}
+
+func BenchmarkLengthLongestDistinct(b *testing.B) {
+	for i := 0; i < b.N; i++ {
+		for _, tc := range testcases {
+			LengthLongestDistinct(tc.nums)
+		}
+	}
+}