I hereby claim:
- I am akr4 on github.
- I am akr4 (https://keybase.io/akr4) on keybase.
- I have a public key ASDy2rbkgMGELpnY2TMrZiXjH5F5N1ezWt1HMB2K-0f-igo
To claim this, I am signing this object:
| //! A reproducer of the 'database is locked' error. | |
| //! https://www2.sqlite.org/cvstrac/wiki?p=DatabaseIsLocked | |
| //! | |
| //! The error happens like this: | |
| //! ``` | |
| //! thread 'tokio-runtime-worker' panicked at 'called `Result::unwrap()` on an `Err` value: Database(SqliteError { code: 5, message: "database is locked" })', src/bin/multiple.rs:35:22 | |
| //! ``` | |
| //! The code is "5", while the wiki page says it is 6. | |
| //! | |
| //! ```toml |
| use sqlx::sqlite::SqlitePoolOptions; | |
| use anyhow::Result; | |
| use sqlx::{Row, SqlitePool}; | |
| fn main() {} | |
| #[tokio::test] | |
| async fn test() -> Result<()> { | |
| const LOOP_COUNT: usize = 10; | |
| let db_dir = tempfile::tempdir()?; |
| use std::cell::RefCell; | |
| #[cfg(test)] | |
| use std::collections::LinkedList; | |
| use std::rc::Rc; | |
| #[derive(Debug, PartialEq, Eq)] | |
| pub struct TreeNode { | |
| pub val: i32, | |
| pub left: Option<Rc<RefCell<TreeNode>>>, | |
| pub right: Option<Rc<RefCell<TreeNode>>>, |
| #[derive(PartialEq, Eq, Clone, Debug)] | |
| pub struct ListNode { | |
| pub val: i32, | |
| pub next: Option<Box<ListNode>>, | |
| } | |
| impl ListNode { | |
| #[inline] | |
| fn new(val: i32) -> Self { | |
| ListNode { next: None, val } |
I hereby claim:
To claim this, I am signing this object:
| # https://github.com/stedolan/jq/issues/243#issuecomment-48470943 | |
| jqpath () { | |
| jq '[path(..)|map(if type=="number" then "[]" else tostring end)|join(".")|split(".[]")|join("[]")]|unique|map("."+.)|.[]' | |
| } |
| String a = "𠮷"; | |
| System.out.println("original: " + a); | |
| System.out.println("length: " + a.length()); | |
| System.out.println("decoded: " + a.codePoints().mapToObj(Character::toChars).map(String::valueOf).collect(Collectors.joining(","))); |
| import xml.etree.ElementTree as ET | |
| import argparse | |
| arg_parser = argparse.ArgumentParser() | |
| arg_parser.add_argument('in_file') | |
| args = arg_parser.parse_args() | |
| def main(args): | |
| with open(args.in_file) as f: | |
| parser = ET.XMLPullParser(['start', 'end']) |
| import numpy as np | |
| import chainer | |
| from chainer import cuda, Function, gradient_check, report, training, utils, Variable, Chain | |
| from chainer import datasets, iterators, optimizers, serializers | |
| from chainer import Link, Chain, ChainList | |
| import chainer.functions as F | |
| import chainer.links as L | |
| from chainer.training import extensions | |
| #!/bin/sh | |
| # Usage: | |
| # ./any2pdf index.html | |
| # ./any2pdf main.go | |
| # | |
| # Requirements: | |
| # - Pygments | |
| # - ImageMagick | |
| # - wkhtmltopdf |