This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket | |
(require racket/control) | |
; ((reset (shift k (lambda (state) 2))) 0) | |
(define (tick _) (shift k (lambda (state) ((k '()) (+ state 1))))) | |
(define (get _) (shift k (lambda (state) ((k state) state)))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang slideshow | |
(require racket/control) | |
;(reset (shift k "hello")) | |
;(define (f x) (reset (string-append (shift k "hello")) "world")) | |
((reset (- (+ 3 (shift k k)) 1)) 3) | |
(let ((c (reset (string-append (shift k k) "fuga")))) | |
(c "poyo")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang slideshow | |
(require racket/control) | |
;; http://pllab.is.ocha.ac.jp/~asai/cw2011tutorial/main-j.pdf | |
;; ツリーは空リストか(left, int, right)のトリプレット | |
(define (walk tree) | |
(if (null? tree) | |
'() | |
(let ((t1 (car tree)) (n (cadr tree)) (t2 (caddr tree))) | |
(walk t1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GPT-4 | |
User | |
Please help me to troubleshoot the update of Pleroma. I am updating Pleroma 2.3 running on AWS lightsail to Pleroma 2.5 with OTP installation. I tried it but the migration failed with the error saying "function associated_object_id(jsonb) does not exist". According to a forum, this trouble happens when we update Pleroma skipping Pleroma 2.4. I tried it with "pleroma_ctl update --branch v2.4.5", but it failed. I checked GitLab of Pleroma, but the artifact of v2.4.5 was already outdated. Could you give me an advice? | |
ChatGPT | |
The error message "function associated_object_id(jsonb) does not exist" suggests that there is an issue with the database migration during the update. As you have mentioned, skipping versions during an update can cause these kind of problems, because every version might come with its own database migrations. | |
It seems like you're having trouble accessing the specific version (v2.4.5) you need from the official GitLab due to outdated artifacts. You can follow the steps below |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
User | |
Please help me to read a textbook of algebra. Let k be a field, f be an element of k[x, y], R be the quotient ring k[x, y]/(f), and θ be the surjection from k[x, y] onto R. The textbook says that the pullback of a maximal ideal of R with θ is maximal in a proof. Is it true? Did I failed to read an important assumption? | |
ChatGPT | |
Yes, it is true that the pullback of a maximal ideal of R with θ is maximal, assuming that k is an algebraically closed field. This is a key assumption that is often used in algebraic geometry and commutative algebra, so make sure you didn't miss it in your textbook. Here's a brief explanation of the proof: | |
Let M be a maximal ideal in R, and let N = θ^(-1)(M) be the pullback of M in k[x, y]. We want to show that N is a maximal ideal in k[x, y]. To do this, we'll use the following facts: | |
If A is a commutative ring with unity, and I and J are ideals of A such that I ⊆ J, then A/J is a quotient ring of A/I. | |
An ideal P of a commutative ring A is maximal if and only if the quotie |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use proconio::input; | |
use proconio::marker::Usize1; | |
use num::integer::gcd; | |
use std::collections::{HashMap, HashSet, BinaryHeap}; | |
fn main() { | |
input!{ | |
n: i64, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mod nibutan{ | |
// bとuはinclusive | |
pub fn true_false(b: i64, u: i64, f: &dyn Fn(i64)->bool) -> (Option<i64>, Option<i64>){ | |
assert!(b <= u); | |
if f(b) == false{ | |
return (None, Some(b)); | |
} | |
if f(u) == true{ | |
return (Some(u), None); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mod union_find{ | |
pub struct UnionFind{ | |
pub parent: Vec<usize>, | |
rank: Vec<usize>, | |
islands: i64 | |
} | |
impl UnionFind{ | |
pub fn new(n: usize) -> UnionFind{ | |
return UnionFind{parent: (0..n).collect(), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mod zp{ | |
use super::arith_util; | |
#[derive(Debug, Clone, Copy, Eq, PartialEq)] | |
pub struct Zp{ | |
pub val: i64, | |
pub p: i64 | |
} | |
impl Zp{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mod acc_util{ | |
pub struct Accum{ | |
acc: Vec<i64> | |
} | |
impl Accum{ | |
pub fn new(a: &Vec<i64>) -> Accum{ | |
let mut acc: Vec<i64> = vec![]; | |
let mut s = 0; | |
for i in a{ |
NewerOlder