给定:
- 请求序列
k1, k2, ... - 容量上限
C - 当前驻留集合
S,满足|S| <= C
| name: Rules overwrites | |
| rules: | |
| - 'DOMAIN-SUFFIX,bsky.app,BosLife' | |
| - 'DOMAIN-SUFFIX,hanime1.me,BosLife' | |
| - 'DOMAIN-SUFFIX,mastodon.social,BosLife' | |
| - 'DOMAIN-SUFFIX,github.io,BosLife' | |
| - 'DOMAIN-SUFFIX,arxiv.org,BosLife' | |
| - 'DOMAIN-SUFFIX,docs.rs,BosLife' | |
| - 'DOMAIN-SUFFIX,zed.dev,BosLife' | |
| - 'DOMAIN-SUFFIX,hackmd.io,BosLife' |
| name: DNS nameserver overwrites | |
| dns: | |
| nameserver: | |
| - system |
| // https://davidlattimore.github.io/posts/2025/09/02/rustforge-wild-performance-tricks.html | |
| // https://github.com/rust-lang/libs-team/issues/674 | |
| fn reuse_vec<T, U>(mut v: Vec<T>) -> Vec<U> { | |
| const { | |
| assert!(size_of::<T>() == size_of::<U>()); | |
| assert!(align_of::<T>() == align_of::<U>()); | |
| } | |
| v.clear(); | |
| v.into_iter().map(|_| unreachable!()).collect() | |
| } |
| package org.example; | |
| import com.fasterxml.jackson.annotation.JsonIgnore; | |
| import com.fasterxml.jackson.annotation.JsonSubTypes; | |
| import com.fasterxml.jackson.annotation.JsonTypeInfo; | |
| import com.fasterxml.jackson.annotation.JsonTypeName; | |
| import com.fasterxml.jackson.databind.ObjectMapper; | |
| import lombok.Builder; | |
| import lombok.SneakyThrows; | |
| import lombok.Value; |
| /// ref: [zhihu](https://zhuanlan.zhihu.com/p/378252833) | |
| use crate::foo::{IncreaseOnly, new_increase_only}; | |
| fn main() { | |
| let mut x1 = new_increase_only!(0); | |
| let mut x2 = new_increase_only!(2); | |
| let y = 1; | |
| // only can be used in `x1` | |
| let le = x1.check_less_or_equal(y).unwrap(); |
| {-# LANGUAGE GADTs #-} | |
| {-# LANGUAGE KindSignatures #-} | |
| {-# LANGUAGE MultiParamTypeClasses #-} | |
| module Main where | |
| class Monad m => Handler (g :: * -> *) (m :: * -> *) where | |
| handle :: g a -> (a -> m b) -> m b | |
| data Freer :: (* -> *) -> * -> * where |
| let langserver: ExampleLanguageServer | null = null; | |
| export const activate = function() { | |
| langserver = new ExampleLanguageServer(); | |
| } | |
| export const deactivate = function() { | |
| if (langserver) { | |
| langserver.stop(); | |
| langserver = null; |
| // see https://apple.stackexchange.com/a/430338/433504 | |
| function fn() { | |
| const cursorSizeSmall = 1 | |
| const cursorSizeLarge = 4 | |
| const isRunningSystemPreferences = Application('System Preferences').running() | |
| Application('System Preferences').panes.byId('com.apple.preference.universalaccess').anchors.byName('Seeing_Cursor').reveal() | |
| const process = Application('System Events').processes.byName('System Preferences') | |
| while (process.windows.length == 0) {} |
| /** | |
| * MacEditorTextView | |
| * Copyright (c) Thiago Holanda 2020-2021 | |
| * https://twitter.com/tholanda | |
| * | |
| * MIT license | |
| * Modified by https://github.com/cjwcommuny for TextKit 2 | |
| */ | |
| import Combine |