Skip to content

Instantly share code, notes, and snippets.

#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))))
#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"))
#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)
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
@ashiato45
ashiato45 / README.md
Last active June 15, 2023 16:23
Rank minimization using Nuclear norm optimization for python3 using CVXOPT

This is a small modification of [http://cvxopt.org/applications/nucnrm/] for Python3 & CVXOPT. As the comment says, this program was originally written by Z. Liu and L. Vandenberghe, and it distributed under GPL.

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
mod bv_util{
pub fn fill(n: usize) -> u64{
return (1 << n) - 1;
}
pub fn subtract(a: u64, b: u64) -> u64{
return a & (!b);
}
pub fn is_on(a: u64, pos: usize) -> bool{
use proconio::input;
use proconio::marker::Usize1;
use num::integer::gcd;
use std::collections::{HashMap, HashSet, BinaryHeap};
fn main() {
input!{
n: i64,
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);
}
use proconio::input;
use proconio::marker::Usize1;
use num::integer::gcd;
use std::collections::{HashMap, HashSet, BinaryHeap};
fn main() {
let mut n: usize;
input!{
n: usize,