More kbin codeblocks (so I can use kbin.earth for testing too)
Pamasich 7mo ago • 100%
Testing how long a comment takes to federate
1
Testing if it works better now than last week
``` var k = 3; ``` Testing to see how long an edit takes to federate.
How does this look on kbin.social? ``` var k = 3; ```
Codeblock Federation Test
Pamasich 7mo ago • 100%
Can I federate it to a new instance by commenting again?
1
How does this look on kbin.social? ```javascript var k = 3; ```
How does this federate to kbin? ::: spoiler Test SomeText here's how this movie ends something something :::
KES fix-codeblocks tests
Pamasich 10mo ago • 100%
Java
(example provided by Edge Copilot)
// A generic class to store a pair of values of any type that implements Comparable
public class Pair<T extends Comparable<T>> {
// Declare two private fields of type T
private T first;
private T second;
// Define a constructor that takes two arguments of type T
public Pair(T first, T second) {
// Assign the arguments to the fields
this.first = first;
this.second = second;
}
// Define a getter method for the first field
public T getFirst() {
return first;
}
// Define a getter method for the second field
public T getSecond() {
return second;
}
// Define a method to compare the two values and return the larger one
public T max() {
// Use the compareTo method of the Comparable interface
if (first.compareTo(second) > 0) {
return first;
} else {
return second;
}
}
// Define a method to compare the two values and return the smaller one
public T min() {
// Use the compareTo method of the Comparable interface
if (first.compareTo(second) < 0) {
return first;
} else {
return second;
}
}
// Define a method to return a string representation of the pair
public String toString() {
return "(" + first + ", " + second + ")";
}
}
public class Main {
// Test the Pair class with different types
public static void main(String[] args) {
// Create a pair of integers
Pair<Integer> p1 = new Pair<>(10, 20);
System.out.println("p1 = " + p1);
System.out.println("The larger value of p1 is " + p1.max());
System.out.println("The smaller value of p1 is " + p1.min());
// Create a pair of strings
Pair<String> p2 = new Pair<>("Hello", "World");
System.out.println("p2 = " + p2);
System.out.println("The larger value of p2 is " + p2.max());
System.out.println("The smaller value of p2 is " + p2.min());
}
}
(example provided by Edge Copilot)
1
KES fix-codeblocks tests
Pamasich 10mo ago • 100%
Rust
(example provided by Edge Copilot)
// A generic function to swap two values of any type that implements Copy
fn swap<T: Copy>(x: &mut T, y: &mut T) {
// Use a temporary variable to store the value of x
let temp = *x;
// Assign the value of y to x
*x = *y;
// Assign the value of temp to y
*y = temp;
}
fn main() {
// Test the swap function with different types
let mut a = 10;
let mut b = 20;
println!("Before swap: a = {}, b = {}", a, b);
swap(&mut a, &mut b);
println!("After swap: a = {}, b = {}", a, b);
let mut c = "Hello";
let mut d = "World";
println!("Before swap: c = {}, d = {}", c, d);
swap(&mut c, &mut d);
println!("After swap: c = {}, d = {}", c, d);
}
1
KES fix-codeblocks tests
Pamasich 10mo ago • 100%
General
Test test
test test
also testing if two code blocks in the same comment work
what about an intentional end tag
</span>
<span style="color:#000000">some intentional code</span>
1