ysc3839 最近的时间轴更新
ysc3839's repos on GitHub
C++ · 1298 人关注
FontMod
Simple hook tool to change Win32 program font.
C++ · 813 人关注
AudioPlaybackConnector
Bluetooth audio playback (A2DP Sink) connector for Windows 10 2004+
C++ · 135 人关注
ClashXW
This project aims to implement a program with same function as ClashX, running in Windows.
Python · 57 人关注
bilibili-api
Python · 40 人关注
FakeSSHServer
A fake ssh server written in Python. Uses Paramiko.
C++ · 21 人关注
AppXLauncher
JavaScript · 6 人关注
disqusjs-proxy
Disqus API Proxy in Node.js
C++ · 4 人关注
FileMod
JavaScript · 3 人关注
ga-pageview
1 人关注
Amazing-Windows-Apps
📗Introduce you amazing Windows apps🕶READ ONLINE 👉
JavaScript · 1 人关注
flarum-ext-usercard-uid
0 人关注
AutomataTranslator
JavaScript · 0 人关注
bootstrap
The most popular HTML, CSS, and JavaScript framework for developing responsive, mobile first projects on the web.
0 人关注
c4core
C++ utilities
0 人关注
clash
A rule-based tunnel in Go.
C++ · 0 人关注
ConEmu
Customizable Windows terminal with tabs, splits, quake-style and more
C++ · 0 人关注
CWTDGen
C++ · 0 人关注
DevToggle
JavaScript · 0 人关注
DisqusJS
:speech_balloon: Alternative Disqus - Render comments with Disqus API
0 人关注
disqusjs-proxy-example
Using Now as Disqus API Proxy
Lua · 0 人关注
docker-dst-server
Don't Starve Together dedicated server in Docker!
0 人关注
fast_float
Fast and exact implementation of the C++ from_chars functions for float and double types: 4x faster than strtod
0 人关注
genshin-schedule
🕑 Genshin farming scheduler
0 人关注
genshin-wish-export
Easily export the Genshin Impact wish record.
Pascal · 0 人关注
GitInfo
Git and SemVer Info from MSBuild, C# and VB
C++ · 0 人关注
GTA4.CHS
Grand Theft Auto IV: The Complete Edition汉化补丁
0 人关注
GTAIV
CSS · 0 人关注
hexo-theme-material
Material Design theme for hexo.
JavaScript · 0 人关注
hexo-theme-suka
🎨Modern, powerful and simple theme for Hexo.
ysc3839

ysc3839

V2EX 第 27712 号会员,加入于 2012-10-07 03:13:44 +08:00
今日活跃度排名 5271
根据 ysc3839 的设置,主题列表只有在你登录之后才可查看
二手交易 相关的信息,包括已关闭的交易,不会被隐藏
ysc3839 最近回复了
1 小时 10 分钟前
回复了 LemonedQ 创建的主题 Windows 关于 win11 的 win+space 语言切换
这种不跟手的设计,我估计又是学 macOS 的,印象中 macOS 切输入法也是要按一会才显示。
7 小时 17 分钟前
回复了 aqtata 创建的主题 C++ 这种情况如何消除几百个 if/else
@bluearc @abc612008
不对,模板可以解决,需要手动把所有可能的取值写出来,例如:
test<0x1f0, 0x1f1, 0x1f2>(i);

如果能接受非标准扩展的话,有种办法可以把取值加到宏列表里:
#include <cstdio>
#include <cstdlib>

template<int N>
void func();

template<typename T = void>
void test(int n)
{
puts("test() failed!");
}

template<int N, int... ints>
void test(int n)
{
printf("test<%i>(%i)\n", N, n);
if (n == N) {
func<N>();
} else {
test<ints...>(n);
}
}

#define PUSHVAL _Pragma("push_macro(\"VALUES\")")
#define POPVAL _Pragma("pop_macro(\"VALUES\")")

#define VALUES 2
template<>
void func<2>()
{
puts("func<2>()");
}

PUSHVAL
#undef VALUES
#define VALUES POPVAL VALUES, 3
template<>
void func<3>()
{
puts("func<3>()");
}

PUSHVAL
#undef VALUES
#define VALUES POPVAL VALUES, 5
template<>
void func<5>()
{
puts("func<5>()");
}

PUSHVAL
#undef VALUES
#define VALUES POPVAL VALUES, 7
template<>
void func<7>()
{
puts("func<7>()");
}

int main(int argc, char** argv)
{
if (argc != 2) {
printf("usage: %s <int>\n", argv[0]);
return 1;
}

int n = (int)strtoul(argv[1], nullptr, 0);
printf("n = %i\n", n);

test<VALUES>(n);
}

上述方法在 gcc 中有效,msvc 无效。
10 小时 46 分钟前
回复了 aqtata 创建的主题 C++ 这种情况如何消除几百个 if/else
@bluearc @abc612008
是我搞错了,用这种方式还是得把可能的取值写出来,不然模板不会实例化,还是避免不了 if else 。
这么写只能让代码更直观,因为数值不是写在函数名内。
11 小时 19 分钟前
回复了 aqtata 创建的主题 C++ 这种情况如何消除几百个 if/else
@abc612008 用 stringstream 解析确实可能是 GPT 写的,但是直接传参(非运行时,代码里写的是字符串字面量)再转成常量是可行的,constexpr 就可以。
11 小时 24 分钟前
回复了 Sanarara 创建的主题 NAS 要注意, qBittorrent 自动运行 torrent 传播的挖矿脚本
那个脚本要用户自己去设置里填写的吧?怎么可能自动从种子里获取?感觉是别的地方被入侵了,比如说开启了 WebUI 没设置密码暴露到公网上了。
21 小时 41 分钟前
回复了 kirieievk 创建的主题 淘宝 香港开的银行卡.怎么可以在国内淘宝购物呢
@kirieievk @zhouyin 汇丰 Mastercard 扣账卡就可以
1 天前
回复了 ssh 创建的主题 问与答 windows 平台有没有这样一款系统监控软件?
CPU 温度是最麻烦的,需要针对不同硬件适配
@KoreaFish 所以说有的时候你去香港开门槛反而更低
@yangyifan catch all 是能看到原始收件邮箱的
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2712 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 13ms · UTC 12:18 · PVG 20:18 · LAX 04:18 · JFK 07:18
Developed with CodeLauncher
♥ Do have faith in what you're doing.