PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: favonia/cloudflare-ddns (go)

Issue:
Use DNS record comments in a creative way
Maybe add `Created by cloudflare-ddns 😺` as the comment of newly created DNS records.

- [ ] cloudflare/cloudflare-go#1166

Announcement of the new API: https://developers.cloudflare.com/dns/manage-dns-records/reference/record-attributes/

Pull request:
feat: annotate newly created DNS records
Close #354.

Patch:
diff --git a/internal/api/cloudflare.go b/internal/api/cloudflare.go
index 0b4e8c7..6617148 100644
--- a/internal/api/cloudflare.go
+++ b/internal/api/cloudflare.go
@@ -279,6 +279,7 @@ func (h *CloudflareHandle) CreateRecord(ctx context.Context, ppfmt pp.PP,
 		Content: ip.String(),
 		TTL:     ttl.Int(),
 		Proxied: &proxied,
+		Comment: "Created by cloudflare-ddns",
 	}
 
 	res, err := h.cf.CreateDNSRecord(ctx, cloudflare.ZoneIdentifier(zone), params)


Test patch:
diff --git a/internal/api/cloudflare_test.go b/internal/api/cloudflare_test.go
index 8a24a06..a91b8c2 100644
--- a/internal/api/cloudflare_test.go
+++ b/internal/api/cloudflare_test.go
@@ -1023,6 +1023,7 @@ func TestCreateRecordValid(t *testing.T) {
 				require.Equal(t, "::1", record.Content)
 				require.Equal(t, 100, record.TTL)
 				require.Equal(t, false, *record.Proxied)
+				require.Equal(t, "Created by cloudflare-ddns", record.Comment)
 				record.ID = "record1"
 
 				w.Header().Set("content-type", "application/json")
Repository: bitshifter/glam-rs (rust)

Issue:
Add `Mat4::ortho`
Because orthographic projections are cool.  If you want this, I'll happily PR it.

Pull request:
Basic right-handed orthographic matrix function.
A little WIP at the moment still, but it's Code That I've Used
So I Know It Works(tm).  Barring typos, I guess.  Also checked
against `glm::ortho`.  I agree that we do want actual unit tests
though, so that's what I'm going to attempt next.

Will resolve #32.

Patch:
diff --git a/src/f32/mat4.rs b/src/f32/mat4.rs
index 100519f..dbd9f1c 100644
--- a/src/f32/mat4.rs
+++ b/src/f32/mat4.rs
@@ -540,6 +540,24 @@ impl Mat4 {
         )
     }
 
+    /// Build right-handed orthographic projection matrix with the specified bounds and depth range.
+    pub fn orthographic_rh(left: f32, right: f32, bottom: f32, top: f32, near: f32, far: f32) -> Mat4 {
+        let a = 2.0 / (right - left);
+        let b = 2.0 / (top - bottom);
+        let c = -2.0 / (far - near);
+        let d1 = -(right + left) / (right - left);
+        let d2 = -(top + bottom) / (top - bottom);
+        let d3 = -(far + near) / (far - near);
+
+        Mat4::from_cols(
+            Vec4::new(a, 0.0, 0.0, 0.0),
+            Vec4::new(0.0, b, 0.0, 0.0),
+            Vec4::new(0.0, 0.0, c, 0.0),
+            Vec4::new(d1, d2, d3, 1.0),
+        )
+    }
+
+
     #[inline]
     pub fn mul_vec4(&self, other: Vec4) -> Vec4 {
         let mut res = self.x_axis * other.dup_x();


Test patch:
diff --git a/tests/mat4.rs b/tests/mat4.rs
index a76ec4b..f6d54ac 100644
--- a/tests/mat4.rs
+++ b/tests/mat4.rs
@@ -254,6 +254,14 @@ fn test_mat4_look_at() {
     assert_approx_eq!(rh.transform_point3(point), Vec3::new(0.0, 1.0, -5.0));
 }
 
+#[test]
+fn test_mat4_orthographic_rh() {
+    let projection = Mat4::orthographic_rh(-10.0, 10.0, -5.0, 5.0, 0.0, -10.0);
+    let original = Vec4::new(5.0, 5.0, -5.0, 1.0);
+    let projected = projection.mul_vec4(original);
+    assert_approx_eq!(projected, Vec4::new(0.5, 1.0, -2.0, 1.0));
+}
+
 #[test]
 fn test_mat4_ops() {
     let m0 = Mat4::from_cols_array_2d(&MATRIX);