跳转至内容
  • [xlings]: 常见问题汇总

    xlings
    1
    0 赞同
    1 帖子
    114 浏览
    尚无回复
  • 0 赞同
    10 帖子
    231 浏览
    eternity-ghE

    @d2learn-dev 已解决

  • 0 赞同
    1 帖子
    124 浏览
    尚无回复
  • 0 赞同
    1 帖子
    60 浏览
    尚无回复
  • 0 赞同
    1 帖子
    51 浏览
    尚无回复
  • 0 赞同
    3 帖子
    106 浏览
    sunrisepeakS

    @sunrisepeak 全局队列或许也可以用CAS优化

  • 板块说明

    CS144 | 计算机网络导论
    1
    0 赞同
    1 帖子
    122 浏览
    尚无回复
  • 0 赞同
    1 帖子
    179 浏览
    尚无回复
  • run命令找不到文件

    已锁定 已解决 xlings
    16
    1 赞同
    16 帖子
    316 浏览
    baiyiusersB

    @d2learn-dev 解决了,可以在D盘运行了😳 f7698859-ba39-49a5-918a-a321cc958de1-image.png

  • 关于c++ chrono库中类型方面的问题

    已锁定 已解决 General Discussion | 综合讨论
    2
    0 赞同
    2 帖子
    89 浏览
    sunrisepeakS

    chrono:xxseconds 一般是duration的别名

    _EXPORT_STD using nanoseconds = duration<long long, nano>; _EXPORT_STD using microseconds = duration<long long, micro>; _EXPORT_STD using milliseconds = duration<long long, milli>; _EXPORT_STD using seconds = duration<long long>; _EXPORT_STD using minutes = duration<int, ratio<60>>; _EXPORT_STD using hours = duration<int, ratio<3600>>;

    而duration的构造存在隐式类型转换, 他的构造函数是一个模板, 在构造函数里会使用duration_cast把std::chrono::milliseconds转成chrono::microseconds

    template <class _Rep2, enable_if_t<is_convertible_v<const _Rep2&, _Rep> && (treat_as_floating_point_v<_Rep> || !treat_as_floating_point_v<_Rep2>), int> = 0> constexpr explicit duration(const _Rep2& _Val) noexcept(is_arithmetic_v<_Rep> && is_arithmetic_v<_Rep2>) // strengthened : _MyRep(static_cast<_Rep>(_Val)) {} template <class _Rep2, class _Period2, enable_if_t<treat_as_floating_point_v<_Rep> || (_Ratio_divide_sfinae<_Period2, _Period>::den == 1 && !treat_as_floating_point_v<_Rep2>), int> = 0> constexpr duration(const duration<_Rep2, _Period2>& _Dur) noexcept(is_arithmetic_v<_Rep> && is_arithmetic_v<_Rep2>) // strengthened : _MyRep(_CHRONO duration_cast<duration>(_Dur).count()) {} // 具体转换的代码 _NODISCARD constexpr _Rep count() const noexcept(is_arithmetic_v<_Rep>) /* strengthened */ { return _MyRep; }

    https://github.com/microsoft/STL/blob/a1bc1261795d4097cf7c12cfd0b5e2091809f281/stl/inc/__msvc_chrono.hpp#L110-L117

  • [xlings]: 工具基础信息

    已固定 xlings
    1
    0 赞同
    1 帖子
    247 浏览
    尚无回复
  • 1 赞同
    2 帖子
    336 浏览
    sunrisepeakS

    @tiansongyu 在 使用AI代理游玩所有任天堂NES游戏(红白机)详细教程----基于gym-retro、pygame、stable-baselines3 中说:

    示例图片 2

    这个中间的游戏 很经典的对站游戏。里面的 能发地波的忍者 和 哪个龙的 大鹏展翅 记忆深刻

  • 上线官网 - d2learn.org - 初步

    Announcements | 公告
    1
    0 赞同
    1 帖子
    55 浏览
    尚无回复
  • 视频链接展开测试

    Announcements | 公告
    15
    0 赞同
    15 帖子
    245 浏览
    sunrisepeakS

    logo.gif

  • 0 赞同
    5 帖子
    107 浏览
    sunrisepeakS

    @Littlefean 在 [Features]: 工具汇总页(分类 + 图标 + 简介): 把常用的工具进行汇总, 添加 在线工具页面 中说:

    https://patorjk.com/software/taag/#p=display&f=Graffiti&t=Type Something
    大型字符画编辑器,可以用于控制台上输出一个超大英文单词欢迎信息

    这个不错 之前都是让 gpt来绘制 大的字母

    1a30d104-1c2c-4b28-83e7-87e2a1809a3e-image.png

  • 如何把imgui和OpenGL结合?

    已锁定 已解决 General Discussion | 综合讨论
    7
    0 赞同
    7 帖子
    205 浏览
    lu9943L

    @sunrisepeak 我明白了,原来在imgui的例子里已经有了OpenGL的渲染例子,我报错的原因就是在main里又加了新的OpenGL的渲染代码进去😁 感谢指导

  • D2Learn Opensource - 简介

    已固定 d2learn开源
    1
    0 赞同
    1 帖子
    127 浏览
    尚无回复
  • 增加在线工具功能

    Announcements | 公告
    2
    0 赞同
    2 帖子
    108 浏览
    尚无回复
  • 开启邮件服务

    Announcements | 公告
    3
    0 赞同
    3 帖子
    98 浏览
    sunrisepeakS

    @lu9943 社区的用户注册和邮件认证

  • 0 赞同
    2 帖子
    108 浏览
    LittlefeanL

    增加了一个像素点之间液化连接视觉测试功能

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Document</title> <style> body { background-color: black; color: white; display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100vh; /* 使 body 高度为视口高度 */ margin: 0; /* 去除默认的 margin */ } .matrix { display: flex; flex-direction: column; margin: 10px 0; padding: 5px; filter: contrast(500%); } .row { display: flex; } .cell { width: 20px; /* 每个单元格的宽度 */ height: 20px; /* 每个单元格的高度 */ display: flex; align-items: center; justify-content: center; border: none; /* 单元格边框 */ margin: 0; /* 单元格间距 */ filter: blur(10px); /* 默认模糊效果 */ transition: filter 0.3s ease; /* 过渡效果 */ } .cell.true { background-color: rgb(255, 255, 255); /* 1 的背景色 */ } .cell.false { background-color: rgb(0, 0, 0); /* 0 的背景色 */ } .slider-container { margin-top: 20px; /* 滑动框与矩阵的间距 */ } .input-container { margin-bottom: 20px; /* 输入框与滑动框的间距 */ } </style> </head> <body> <div class="input-container"> <label for="wordInput">输入单词: </label> <input type="text" id="wordInput" value="d2learn" /> <button id="lookUpButton">查询</button> </div> <div class="slider-container"> <label for="blurRange">调整模糊程度: </label> <input type="range" id="blurRange" min="0" max="50" value="10" /> </div> <div class="slider-container"> <label for="contrastRange">调整对比度: </label> <input type="range" id="contrastRange" min="100" max="5000" value="500" /> </div> <script> function charToAsciiBinaryArray(char) { const asciiCode = char.charCodeAt(0); const binaryString = asciiCode.toString(2).padStart(8, "0"); return Array.from(binaryString, (bit) => bit === "1"); } function stringToBinaryArrays(str) { return str.split("").map(charToAsciiBinaryArray); } function updateMatrix(word) { const d2learnBinaryArray = stringToBinaryArrays(word); // 清空矩阵内容 matrixContainer.innerHTML = ""; // 创建新的矩阵并添加到 body 中 d2learnBinaryArray.forEach((row) => { const rowDiv = document.createElement("div"); rowDiv.className = "row"; row.forEach((cell) => { const cellDiv = document.createElement("div"); cellDiv.className = "cell " + (cell ? "true" : "false"); rowDiv.appendChild(cellDiv); }); matrixContainer.appendChild(rowDiv); }); } const matrixContainer = document.createElement("div"); matrixContainer.className = "matrix"; document.body.appendChild(matrixContainer); // 初始化默认显示 "d2learn" 的矩阵 updateMatrix("d2learn"); // 处理输入框和查询按钮的事件 const lookUpButton = document.getElementById("lookUpButton"); lookUpButton.addEventListener("click", () => { const word = document.getElementById("wordInput").value; // 获取输入的单词 updateMatrix(word); // 更新矩阵 }); // 处理模糊度滑动框的输入事件 const blurRange = document.getElementById("blurRange"); blurRange.addEventListener("input", () => { const blurValue = blurRange.value; // 获取当前的滑动值 const cells = document.querySelectorAll('.cell'); cells.forEach(cell => { cell.style.filter = `blur(${blurValue}px)`; // 设置模糊效果 }); }); // 处理对比度滑动框的输入事件 const contrastRange = document.getElementById("contrastRange"); contrastRange.addEventListener("input", () => { const contrastValue = contrastRange.value; // 获取当前的滑动值 matrixContainer.style.filter = `contrast(${contrastValue}%)`; // 设置对比度效果 }); console.log(d2learnBinaryArray); </script> </body> </html>