PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: MyreMylar/pygame_gui (python)

Issue:
UIScrollingContainer sets dimensions instead of position
**Describe the bug**
In the version 0.6.8 that I am using, I spotted that in the `pygame_gui.elements.ui_scrolling_container` file, on line 147 in the `set_position` function, instead of updating the position, it updates the dimensions. (see screenshot below)

**Expected behaviour**
`self._root_container.set_position(position)` to be called instead of `self._root_container.set_dimensions(position)`

**Screenshots**
<img width="598" alt="image" src="https://github.com/MyreMylar/pygame_gui/assets/74864888/b73ed331-b39d-42e0-8275-cadcd38907b0">

**Version:**
 - Pygame GUI version 0.6.8


Pull request:
Fix UIScrollingContainer .set_position()
fixes #481

Patch:
diff --git a/pygame_gui/elements/ui_scrolling_container.py b/pygame_gui/elements/ui_scrolling_container.py
index 03294de..f51aa56 100644
--- a/pygame_gui/elements/ui_scrolling_container.py
+++ b/pygame_gui/elements/ui_scrolling_container.py
@@ -146,7 +146,7 @@ class UIScrollingContainer(UIElement, IContainerLikeInterface):
         """
 
         super().set_position(position)
-        self._root_container.set_dimensions(position)
+        self._root_container.set_position(position)
 
     def set_relative_position(self, position: Union[pygame.math.Vector2,
                                                     Tuple[int, int],


Test patch:
diff --git a/tests/test_elements/test_ui_scrolling_container.py b/tests/test_elements/test_ui_scrolling_container.py
index a3a9397..0f07096 100644
--- a/tests/test_elements/test_ui_scrolling_container.py
+++ b/tests/test_elements/test_ui_scrolling_container.py
@@ -53,6 +53,7 @@ class TestUIScrollingContainer:
         container.set_position((50, 50))
 
         assert container.rect.topleft == (50, 50)
+        assert container._root_container.rect.size == (200, 200)
 
     def test_set_relative_position(self, _init_pygame, default_ui_manager,
                                    _display_surface_return_none):
Repository: vaskoz/dailycodingproblem-go (go)

Issue:
Day 75
Good morning! Here's your coding interview problem for today.

This problem was asked by Microsoft.

Given an array of numbers, find the length of the longest increasing subsequence in the array. The subsequence does not necessarily have to be contiguous.

For example, given the array `[0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15]`, the longest increasing subsequence has length 6: it is `0, 2, 6, 9, 11, 15`.

Pull request:
Day75
Resolves #159.

Patch:
diff --git a/README.md b/README.md
index a8d7631..fa8dc51 100644
--- a/README.md
+++ b/README.md
@@ -84,3 +84,4 @@ problems from
 * [Day 72](https://github.com/vaskoz/dailycodingproblem-go/issues/153)
 * [Day 73](https://github.com/vaskoz/dailycodingproblem-go/issues/155)
 * [Day 74](https://github.com/vaskoz/dailycodingproblem-go/issues/157)
+* [Day 75](https://github.com/vaskoz/dailycodingproblem-go/issues/159)
diff --git a/day75/problem.go b/day75/problem.go
new file mode 100644
index 0000000..3beb65b
--- /dev/null
+++ b/day75/problem.go
@@ -0,0 +1,39 @@
+package day75
+
+// LongestIncreasingSubsequence returns the longest increasing subsequence.
+// Runs in O(N log N) time.
+func LongestIncreasingSubsequence(X []int) []int {
+	p := make([]int, len(X))
+	m := make([]int, len(X)+1)
+	l := 0
+	for i := range X {
+		lo := 1
+		hi := l
+		for lo <= hi {
+			var mid int
+			if (lo+hi)%2 == 0 {
+				mid = (lo + hi) / 2
+			} else {
+				mid = ((lo + hi) / 2) + 1
+			}
+			if X[m[mid]] < X[i] {
+				lo = mid + 1
+			} else {
+				hi = mid - 1
+			}
+		}
+		newL := lo
+		p[i] = m[newL-1]
+		m[newL] = i
+		if newL > l {
+			l = newL
+		}
+	}
+	s := make([]int, l)
+	k := m[l]
+	for i := range s {
+		s[len(s)-1-i] = X[k]
+		k = p[k]
+	}
+	return s
+}


Test patch:
diff --git a/day75/problem_test.go b/day75/problem_test.go
new file mode 100644
index 0000000..b7e0f60
--- /dev/null
+++ b/day75/problem_test.go
@@ -0,0 +1,30 @@
+package day75
+
+import (
+	"reflect"
+	"testing"
+)
+
+var testcases = []struct {
+	input, expected []int
+}{
+	{[]int{0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15},
+		[]int{0, 2, 6, 9, 11, 15}},
+}
+
+func TestLongestIncreasingSubsequence(t *testing.T) {
+	t.Parallel()
+	for _, tc := range testcases {
+		if result := LongestIncreasingSubsequence(tc.input); !reflect.DeepEqual(tc.expected, result) {
+			t.Errorf("Expected %v got %v", tc.expected, result)
+		}
+	}
+}
+
+func BenchmarkLongestIncreasingSubsequence(b *testing.B) {
+	for i := 0; i < b.N; i++ {
+		for _, tc := range testcases {
+			LongestIncreasingSubsequence(tc.input)
+		}
+	}
+}
Repository: gin-gonic/gin (go)

Issue:
Debug mode documentation incorrect
https://github.com/gin-gonic/gin/blob/094f9a9105f8e7b971a01a64677eef5a1f7bcd9b/mode.go#L31-L32 contradicts https://github.com/gin-gonic/gin/blob/094f9a9105f8e7b971a01a64677eef5a1f7bcd9b/debug.go#L52-L59

The same for https://github.com/gin-gonic/gin/blob/094f9a9105f8e7b971a01a64677eef5a1f7bcd9b/debug.go#L99-L103 contradicts https://github.com/gin-gonic/gin/blob/094f9a9105f8e7b971a01a64677eef5a1f7bcd9b/mode.go#L40-L41

Pull request:
Use DefaultWriter and DefaultErrorWriter for debug messages
Aligns behaviour according to documentation.

Closes #1890.

Patch:
diff --git a/debug.go b/debug.go
index 6d40a5d..19e380f 100644
--- a/debug.go
+++ b/debug.go
@@ -8,7 +8,6 @@ import (
 	"bytes"
 	"fmt"
 	"html/template"
-	"os"
 	"runtime"
 	"strconv"
 	"strings"
@@ -54,7 +53,7 @@ func debugPrint(format string, values ...interface{}) {
 		if !strings.HasSuffix(format, "\n") {
 			format += "\n"
 		}
-		fmt.Fprintf(os.Stderr, "[GIN-debug] "+format, values...)
+		fmt.Fprintf(DefaultWriter, "[GIN-debug] "+format, values...)
 	}
 }
 
@@ -98,6 +97,8 @@ at initialization. ie. before any route is registered or the router is listening
 
 func debugPrintError(err error) {
 	if err != nil {
-		debugPrint("[ERROR] %v\n", err)
+		if IsDebugging() {
+			fmt.Fprintf(DefaultErrorWriter, "[GIN-debug] [ERROR] %v\n", err)
+		}
 	}
 }


Test patch:
diff --git a/debug_test.go b/debug_test.go
index 86a6777..9ace298 100644
--- a/debug_test.go
+++ b/debug_test.go
@@ -111,15 +111,15 @@ func captureOutput(t *testing.T, f func()) string {
 	if err != nil {
 		panic(err)
 	}
-	stdout := os.Stdout
-	stderr := os.Stderr
+	defaultWriter := DefaultWriter
+	defaultErrorWriter := DefaultErrorWriter
 	defer func() {
-		os.Stdout = stdout
-		os.Stderr = stderr
+		DefaultWriter = defaultWriter
+		DefaultErrorWriter = defaultErrorWriter
 		log.SetOutput(os.Stderr)
 	}()
-	os.Stdout = writer
-	os.Stderr = writer
+	DefaultWriter = writer
+	DefaultErrorWriter = writer
 	log.SetOutput(writer)
 	out := make(chan string)
 	wg := new(sync.WaitGroup)
Repository: plaid/sanctuary (js)

Issue:
catMaybes :: [Maybe a] -> [a]
<https://hackage.haskell.org/package/base-4.8.1.0/docs/Data-Maybe.html#v:catMaybes>:

> The `catMaybes` function takes a list of `Maybe`s and returns a list of all the `Just` values.


Pull request:
maybe: add S.catMaybes
Closes #72

`maybe :: b -> (a -> b) -> Maybe a -> b` proved useful in defining this function. I'll rebase this patch once #77 has been merged.


Patch:
diff --git a/index.js b/index.js
index 44421d4..b197d4a 100644
--- a/index.js
+++ b/index.js
@@ -682,10 +682,21 @@
   //. > S.maybe(0, R.length, S.Nothing())
   //. 0
   //. ```
-  S.maybe = def('maybe', [a, Function, Maybe], function(x, f, maybe) {
+  var maybe = S.maybe =
+  def('maybe', [a, Function, Maybe], function(x, f, maybe) {
     return fromMaybe(x, maybe.map(f));
   });
 
+  //# catMaybes :: [Maybe a] -> [a]
+  //.
+  //. Takes a list of Maybes and returns a list containing each Just's value.
+  //.
+  //. ```javascript
+  //. > S.catMaybes([S.Just('foo'), S.Nothing(), S.Just('baz')])
+  //. ["foo", "baz"]
+  //. ```
+  S.catMaybes = def('catMaybes', [Accessible], R.chain(maybe([], R.of)));
+
   //# encase :: (* -> a) -> (* -> Maybe a)
   //.
   //. Takes a function `f` which may throw and returns a curried function


Test patch:
diff --git a/test/index.js b/test/index.js
index 37b3d72..829bb67 100644
--- a/test/index.js
+++ b/test/index.js
@@ -686,6 +686,30 @@ describe('maybe', function() {
 
   });
 
+  describe('catMaybes', function() {
+
+    it('is a unary function', function() {
+      eq(typeof S.catMaybes, 'function');
+      eq(S.catMaybes.length, 1);
+    });
+
+    it('type checks its arguments', function() {
+      assert.throws(function() { S.catMaybes(null); },
+                    errorEq(TypeError,
+                            'The first argument to ‘catMaybes’ ' +
+                            'cannot be null or undefined'));
+    });
+
+    it('returns a list containing the value of each Just', function() {
+      eq(S.catMaybes([]), []);
+      eq(S.catMaybes([S.Nothing(), S.Nothing()]), []);
+      eq(S.catMaybes([S.Nothing(), S.Just('b')]), ['b']);
+      eq(S.catMaybes([S.Just('a'), S.Nothing()]), ['a']);
+      eq(S.catMaybes([S.Just('a'), S.Just('b')]), ['a', 'b']);
+    });
+
+  });
+
   describe('encase', function() {
 
     it('is a unary function', function() {