专栏文章

2025.2.25

个人记录参与者 1已保存评论 0

文章操作

快速查看文章及其快照的属性,并进行相关操作。

当前评论
0 条
当前快照
1 份
快照标识符
@miq534vk
此快照首次捕获于
2025/12/03 23:05
3 个月前
此快照最后确认于
2025/12/03 23:05
3 个月前
查看原文
咕咕好久的博客 开更!之前好像也没说日更啊
今天学到了 cpp20 的一个新特性(或者应该叫语法糖?)
使用 ranges::sort 可以更简洁地进行排序,相比于之前的 sort,区别就是不用再传入首尾迭代器,而是可以直接把容器名丢进去。
例如:
CPP
std::vector<int> numbers = {3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5};
std::ranges::sort(numbers);
默认是非降序排列,而要求降序或者自定义排序方式和之前一样
降序:
CPP
ranges::sort(numbers, ranges::greater());
自定义排序可以传入 lambda 表达式,具体参考 cppreference

啊 果然是阴阳平衡吗,这学期遇到了一个出生中的出生的老师,在学校已经臭名昭著了,但苦于是必修课没法退(
懒得再这里多说,别污染了我的开发日记,祝我好运~
以后每周二下午都要坐牢 3h 了……
无聊……刷钱ing
坚果僵尸:这才是世界上最绝望的死法
话说为什么总是先判定土豆雷身上的南瓜啊喂

那会谷群有人问洛谷查看个人简介的油猴脚本(其实把那个 display: none 删了就行~
或者把 url 里的 .cn 删掉,不过国际站需要魔法
顺手 GPT gen 了一个
JAVASCRIPT
// ==UserScript==
// @name         Luogu User Introduction Fix
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Remove display: none from the user introduction section on Luogu.
// @author       You
// @match        https://www.luogu.com.cn/user/*
// @grant        none
// @run-at       document-idle
// ==/UserScript==

(function() {
    'use strict';

    function showIntroduction() {
        let intro = document.querySelector("#app > div.main-container > main > div > div.full-container > section.main > div > div.introduction.marked");
        if (intro) {
            intro.style.display = '';
        }
    }

    // Run once after page load
    showIntroduction();

    // Observe for changes in case the element is loaded dynamically
    const observer = new MutationObserver(showIntroduction);
    observer.observe(document.body, { childList: true, subtree: true });
})();

晚上继续 幻想大赛 职业生涯规划课坐牢,云云~

评论

0 条评论,欢迎与作者交流。

正在加载评论...