previous >>109393385
上一条 >>109393385
/dpt/ - 每日编程帖
>>109414529
>The Chuduke Journal
>Chuduke 日报
why is C++ the preferred language of Chuds like Coding Jesus?
为什么 C++ 是像 Coding Jesus 这样的 Chuds 的首选语言?
>>109414706
>Oh, would you look at that. LEA some empty string into RCX and then jump to puts, exactly like I suggested. C++ is a ponzi scheme for people unable to read assembly code.
>哦,你看。LEA 一个空字符串到 RCX 然后跳到 puts,跟我想的一样。C++ 就是给看不懂汇编的人设的庞氏骗局。
can you really trust ai?
你真的能信 AI 吗?
i don't have a mentor, so i keep using it for studying, but sometimes i wonder if what it says is ok
我没有导师,所以一直用它来学习,但有时候我也怀疑它说的对不对。
the documentation is kind of hard to follow alone
文档一个人看有点难跟。
>>109414859
>>109390379
>>109414868
what would be the best form of study? any tips, please?
最好的学习方式是什么?有什么建议吗,谢谢?
>>109414891
Honestly? Learn assembly, then RE software and libraries.
说实话?学汇编,然后逆向软件和库。
>>109414529
>>109414913
>>109414926
Based.
>>109414859
for most things on the well-trodden path (i.e., popular subjects) the frontier models are very good. if you have difficulty following the docs just send excerpts in the chat and ask for explanations.
大部分常见路径上的东西(也就是热门主题)前沿模型都做得很好。如果你看文档有困难,就把片段发到对话里,直接问解释就行。
I got my knight badge on leetcode!!!
我在 leetcode 上拿到骑士徽章了!!!
So my updated stats are:
所以我的最新数据是:
>1860 elo
>1860 埃罗
>ranking 48k / 880k
>排名 48k / 880k
>7 contests attended
>参加了 7 场比赛
>top 6%
>前 6%
>580 questions solved (95 hards, 320 mediums)
>做了 580 道题(95 道困难,320 道中等)
I was actually surprised it's this easy. You only need to rank around (1,500 - 3,000) / 40k consistently in contests, which equates to being able to solve 3/4 questions within 90 minutes.
我其实很意外这居然这么简单。你只需要在比赛中稳定排到(1,500 - 3,000)/ 40k 左右,这等于能在 90 分钟内解出 4 题里的 3 题。
Now I can finally put this on my resume and get a job !!!
现在我终于能把这个写进简历,然后找工作了!!!
>>109414963
>the well-trodden path
>well-trodden path(常见路径)
The well-trodden path is well-trodden for a reason, because it offers the path of least resistance.
常见路径之所以常见是有原因的,因为它提供了阻力最小的路径。
Which isn't a good thing, because "least resistance" includes every single Pajeet you've ever seen, and there's over a billion of them.
但这不是什么好事,因为“最小阻力”包含了你能见到的每一个 Pajeet,而且他们超过十亿人。
>>109414992
right, and it also includes all the textbooks, lectures and courses developed by (presumably) competent people
没错,它还包括所有由(按理说)有能力的人编写的教科书、讲义和课程。
>>109415040
>by (presumably) competent people
>由(按理说)有能力的人编写
Lol
Lmao
No.
No, they're really not, and you'd know that if you had gone the extra mile: >>109414912
不,他们真的不是,你如果多走一步就会知道了:>>109414912
Applied for a promotion at my job. New title requires proficiency in C++/ML. Bullshitted my way through the first two, but the technical is next week. Any advise on ML bro's?
我申请了升职。新职位要求精通C++/ML。前两轮我瞎扯混过去了,但技术面在下周。老哥们有什么ML的建议吗?
>>109415051
what are you talking about? what does RE have to do with his question? he didn't even say what he's learning.
你在说什么?RE 跟他的问题有什么关系?他都没说他学的是什么。
>>109415100
>what does RE have to do with his question?
>RE 跟他的问题有什么关系?
Are you just ACTUALLY that retarded?
你是真他妈蠢吗?
Are you?
你算吗?
>>109415126
>Are you just ACTUALLY that retarded?
>你是真他妈蠢吗?
obviously, or I wouldn't be talking to you
显然是啊,不然我也不至于跟你说话
>>109415153
Well, then just think about what RE is going to teach you generically.
行,那你就想想 RE 泛泛地能教你什么。
>>109414218
It was still kind of a mess, but considerably simpler now that i had the basics of checking.
现在还是有点乱,但既然我掌握了基础检查方法,已经简单多了。
So now Address and Contract paths are complete, presumably that's most of the work for the EVM path so now just little touches before testing an invoice for real
所以现在 Address 和 Contract 路径完成了,估计 EVM 路径的大部分工作都做完了,接下来就是在正式测试发票前做些小调整。
>>109414926
Man, I still remember when people were roasting me for having enough memory to completely disable swap.
靠,我还记得有人嘲笑我有足够内存去完全禁用 swap。 ⸶⟧ 像你们这些傻逼黑鬼跟我说什么会有无数崩溃之类的,结果不仅没发生,我还坐在这儿,RAM 比你们大多数人还多,能同时跑多个程序和游戏。
Like, y'all retarded niggas told me I was gonna have untold amounts and crashes and what not, and not only has that not been true, but I'm sitting here with more RAM than most of y'all niggas and being able to run multiple programs and games at the same time.
你们这些脑子有坑的家伙跟我说会有数不清的死机和各种毛病,结果不但没有,我现在内存比你们大多数人都多,还能同时跑多个程序和游戏。
Just goes to show how /g/ is actually, factually retarded.
这正好说明 /g/ 实际上就是真蠢。
>>109415754
>Man, I still remember when people were roasting me for having enough memory to completely disable swap.
>靠,我还记得有人嘲笑我有足够内存去完全禁用 swap。
why would you do this
你为什么要这么干
>>109415822
Because I don't trust kernel developers to write code to save their autistic lives.
因为我不信内核开发人员能写出救他们自闭命的代码。
more like daily poop thread lmao
这更像每日拉屎帖哈哈哈
So... my SQLite search is too slow and make my computer fans go brrr. I've put over 20 hours into trying to optimize it...
所以……我的 SQLite 搜索太慢了,还让电脑风扇狂转。我已经花了超过 20 个小时想优化它……
Lost my mind trying to get cuda to work on a 1660ti with onnxruntime
我快疯了,就为了让 cuda 在 1660ti 上配合 onnxruntime 跑起来。
What else... oh, I've mcfucking had it with rotting away just to write more code. I will go sit my ass outside and stare at people instead. Goodnight.
还有什么……哦,我他妈受够了烂在家里只为写更多代码。我要出去坐在外面盯着人看。晚安。
>>109414859
>i don't have a mentor, so i keep using it for studying, but sometimes i wonder if what it says is ok
>我没有导师,所以一直拿它来学习,但有时候我会怀疑它说的到底对不对
I've found verifying the little shit is a great way to study, because it forces you to engage with source material straight reading doesn't.
我发现验证这小东西是学习的好方法,因为它逼你去查原始资料,光靠直接读是做不到的。
>>109416086
Just add an index, or use fts4
加个索引就行,或者用 fts4
>>109415754
Some programs literally require swap to be present to run.
有些程序确实必须要 swap 存在才能跑起来。
That you aren't using any of those programs now is fine, but not guaranteed when you make a decision to disable swap.
你现在没用那些程序没问题,但当你决定关掉 swap 的时候,可没法保证以后也不用。
Having some swap present doesn't negatively harm performance or your drive in anyway, so why not just have a small amount of swap available? Give it 1GB or something.
有点 swap 在完全不会影响性能或者伤硬盘,那为什么不留一点点呢?给个 1GB 之类的就行。
>>109416243
too much data , I've spend 20 hours on this , you think I sat there and did try that ? l m a o nigga
数据太多了,我在这上面花了 20 个小时,你觉得我会坐在那儿挨个试吗?哈哈哈卧槽
>>109416338
>Some programs literally require swap to be present to run.
>有些程序确实必须要 swap 存在才能跑起来。
How? What interfaces does any kernel expose to explicitly allocate swap memory?
怎么可能?内核到底暴露了什么接口让你能显式分配 swap 内存?
>>109416365
I don't know, but I have encountered them.
我不知道,但我真遇到过。
It was a selection of distributed computer things where you're running science things that I was running on raspberry pis and I had to have any amount of swap available for them to run, even just 64MB was enough. It wasn't even maxing out the RAM but they'd fail to run if no swap was present.
是一堆分布式计算的东西,跑科学计算任务的,我放在树莓派上跑,必须有 swap 在才能启动,哪怕只有 64MB 都够了。RAM 也没满,但没有 swap 它们就拒绝运行。
>>109416506
Honestly, that sounds more like they had overcommit disabled, and since Linux applications are utter shite they just failed at mmap.
说真的,这听起来更像是它们把 overcommit 关了,然后 Linux 应用实在太烂,mmap 就直接失败了。
>>109414926
Lol 2 years ago I bought a 32GB DDR5 stick from Amazon, and it didn't work so I called support and told them it was faulty.
哈哈,两年前我从亚马逊买了根 32GB DDR5 内存条,结果不工作,我打客服说货有问题。
They told me I didn't need to send it back, and they just sent me another one.
他们告诉我不用退货,直接又给我寄了一根。
Turned out both were fine I just was a retard and needed to update my BIOS.
结果两根都是好的,只是我蠢,忘了更新 BIOS。
>>109414529
>it's not a cult associated with their gender/sex/sexuality though
>但它不是跟性别/性取向有关的教派啊
>>109414529
>rust programmers are twice more likely to not be a rust programmers than to be trans
>Rust 程序员不是跨性别的可能性,是跨性别的两倍
how do iterators work in rust?
Rust 里的迭代器是怎么工作的?
>>109418561
Like poorly abstracted nonsense.
就像一团抽象得很烂的狗屎。
>>109418584
i'm learning, please explain
我在学,解释一下呗
>>109418599
Alright, take directory iterators: https://doc.rust-lang.org/std/fs/fn.read_dir.html
Both Windows and Linux interfaces do not allow you to provide it with your own buffer. And you need a buffer because kernels do not want you to switch to kernel mode for every single fucking entry, so the underlying calls - NtQueryDirectoryFileEx and getdents - are capable of writing out multiple objects in one go.
Windows 和 Linux 的接口都不允许你提供自己的缓冲区。而你必须有个缓冲区,因为内核不想你每次条目都切到内核态,所以底层调用——NtQueryDirectoryFileEx 和 getdents——都能一次写多个对象出来。
But for that you need a buffer.
但你得有缓冲区才行。
And you can't provide one.
而你又不能自己提供。
>>109414718
do you unironically think someone is reading your wall of text's with absolutely disgusting contrast and font?
你他妈是真觉得有人会读你那堆对比度恶心、字体也恶心的长篇大论吗?
Did you write them all yourself or was it AI?
那些是你自己写的还是 AI 写的?
>>109418709
Are you autistic and get triggered by random noise, or do you simply have bad eyes? Because I have neither, and I can read it just fine.
你是自闭症被随机噪音刺激到了,还是纯粹眼神不好?因为我两种都没有,我看得清清楚楚。
>>109418522
vibecoders and /dpt/ are a match made in heaven
vibecoder 和 /dpt/ 简直是天作之合
>almost no code of any kind posted in the thread
>帖子里几乎没发任何代码
>no finished projects
>没有完成的项目
>just screeching about autists and luddites
>就只在那儿嚎什么自闭症和卢德分子
in the end, both are basically machines that get nothing done
说到底,两个基本上都是干不了活的机器
What is the best library to create graphic interfaces in C? I started a C course, but it doesn't has all I need, what are your recommendations?
用C语言做图形界面,最好的库是哪个?我刚开始学C的课程,但它没覆盖我需要的全部内容,你们有什么推荐?
>>109418750
>Are you autistic
>你有自闭症吗
no (no diagnosis means not autistic)
没有(没诊断就等于不是自闭症)
> and get triggered by random noise
>而且会被随机噪音刺激到
it's not random. I get mostly triggered by noise that is made by humans. Humans walking or talking is the worst.
不是随机的。我主要会被人类发出的噪音刺激到。人走路或说话的声音最难受。
I also get triggered by visual noise, but I am incapable of keeping my shit tidy. So I trigger myself all the time
视觉噪音也会刺激我,但我又没法把自己的东西收拾整齐。所以我自己整天都在刺激自己
>>109418750
Can you explain how this test works?
你能解释一下这个测试怎么运作的吗?
I know I have shit color eyes, but I want to understand what this is telling me.
我知道自己色觉稀烂,但我想搞懂这到底在告诉我什么。
>no diagnosis means not autistic
>没诊断就等于不是自闭症
>psychiatrists just randomly assign autism diagnoses whose symptoms magically manifest
>精神科医生都是随便给自闭症诊断的,症状就神奇地冒出来了
Holy.
>>109418799
You start at the top of a column and read the two letters, then go down. Once you can no longer read both letters in a row you look up how fucked your cone sensitivity is on the right side. It's essentially a red/green/blue test all at once.
你从一列的顶部开始,读出那两个字母,然后往下一行行走。一旦你有一行两个字母都读不出来了,就看右边你的锥细胞敏感度烂到什么程度。这基本就是红绿蓝三色测试一起做。
>>109418836
Ah, so I am nearly completely blind.
啊,那我几乎是全盲了。
>>109418862
sendnudes
>>109418883
For normal, trichromatic people it's "Christmas", since the difference between pink and orange is not strong enough to overcome the difference between pink and cyan. Additionally, since green and orange look almost the same (peanut butter isn't green), for colorblind people the text appears as "Send nudes".
对于正常的三色视觉的人来说是“Christmas”,因为粉色和橙色的差异不够大,压不过粉色和青色的差异。另外,绿色和橙色看起来几乎一样(花生酱不是绿色的),所以对色盲的人来说,这文字看起来就是“Send nudes”。
>>109418522
>>109418862
I can read both if I want to. These tests are made by the CIA
我只要想看两个都能读出来。这些测试都是CIA搞的
>>109418978
>if I want to
>只要想看
That only makes you a normal boring trichromat.
那只能说明你是个普通的无聊三色视觉者。
>>109418796
They are all shit.
它们全都是垃圾。
>>109414913
me on the left, slow weak & inoffensive. People just love me.
左边是我,迟钝、软弱又无攻击性。大家就是喜欢我。
>>109418913
Use your words. I know you can do it.
用你的话说出来。我知道你能行。
>>109414859
Unless you are a subject matter expert too lazy to look something up right now, it is even worse than useless, it's dangerous. Even with common, easy things it will often claims true things are false or false things are "sometimes true" unless you push back heavily, but how could you if you don't know the material enough? Catch-22.
除非你是懒得马上查资料的专家,否则这东西比没用还糟,它很危险。就算是很常见很简单的事,它也经常把真的说成假的,或者把假的说成“有时候是真的”,除非你使劲反驳它,但如果你本身不够懂,你怎么反驳?死循环。
>>109414718
>nah that can't be true, bet he just didn't turn on optimizations
>不可能吧,他肯定只是没开优化
>
.LC0:
.string ""
。细绳 ””
"main":
push rbx
推送RBX
mov esi, OFFSET FLAT:.LC0
mov esi,偏移平面:.LC0
xor edx, edx
将edx清零
sub rsp, 32
子 rsp,32
lea rdi, [rsp+16]
莉亚·迪,[rsp+16]
mov QWORD PTR [rsp], rdi
将rdi的值移动到[rsp]指向的内存位置
call "std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>::_S_copy(char*, char const*, unsigned long)"
调用 "std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>::_S_copy(char*, char const*, unsigned long)"
mov rax, QWORD PTR [rsp]
将 rax 寄存器中的值移动到 rsp 指向的内存位置
mov rsi, rsp
移动RSI、RSP
mov edi, OFFSET FLAT:"std::cout"
mov edi,偏移平面:“std::cout”
mov BYTE PTR [rax], 0
将字节0写入[rax]地址
xor eax, eax
异或 eax, eax
mov QWORD PTR [rsp+8], rax
将 rax 存储到 [rsp+8] 指向的地址(64 位)
call "std::basic_ostream<char, std::char_traits<char>>& std::operator<<<char, std::char_traits<char>, std::allocator<char>>(std::basic_ostream<char, std::char_traits<char>>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)"
调用 "std::basic_ostream<char, std::char_traits<char>>& std::operator<<<char, std::char_traits<char>, std::allocator<char>>(std::basic_ostream<char, std::char_traits<char>>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)"
mov rdi, rax
移动 rdi, rax
call "std::basic_ostream<char, std::char_traits<char>>& std::endl<char, std::char_traits<char>>(std::basic_ostream<char, std::char_traits<char>>&)"
调用 "std::basic_ostream<char, std::char_traits<char>>& std::endl<char, std::char_traits<char>>(std::basic_ostream<char, std::char_traits<char>>&)"
mov rdi, rsp
将 rsp 的值赋给 rdi
call "std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>::_M_dispose()"
调用 "std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>::_M_dispose()"
add rsp, 32
添加 rsp, 32
xor eax, eax
异或 eax, eax
pop rbx
流行的RBX
ret
mov rbx, rax
移动 rbx, rax
mov rdi, rsp
将 rsp 的值赋给 rdi
call "std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>::_M_dispose()"
调用 "std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>::_M_dispose()"
mov rdi, rbx
移动 rdi, rbx
call "_Unwind_Resume"
调用 "_Unwind_Resume"
That's gcc with -Os... with -O3 it's far worse.
这是用 -Os 编译的 gcc……用 -O3 的话更糟。
>>109420241
>unless you push back heavily
>除非你使劲推回
This.
I've had LLMs trying to gaslight me about slow interfaces not being slow until I provided my own data showing that they're full of crap it's hilarious. Also they constantly refer to themselves as AI when there's no thought going on at all; it's just retarded parroting of cultural consensus.
我遇到过LLM跟我扯淡,说慢接口不慢,直到我拿出自己的数据显示它们满嘴胡话,真搞笑。而且它们还老是自称AI,实际上根本没什么思考;纯粹是鹦鹉学舌复读文化共识。
>>109418750
I am color blind and I have only slight difficulty reading the bottom-most letters. Your pic is clearly full of shit.
我色盲,但最底下那行字母我只有稍微有点难读。你这图明显是瞎扯。
>>109418862
Nudes
>>109418836
The only one I can't fully read is "your green vision" (can't make out the rest). Everything else is clear.
我唯一完全读不出的是“你的绿色视力”(后面看不清)。其他都清清楚楚。
>>109420294
What blindness specifically?
具体是哪种色盲?
>>109415754
Swap is about being able to hibernate THOUGH
交换空间跟能休眠有关啊
The more ram you have, the more swap you need THOUGHBEIT.
虽然内存越多,你需要的交换空间也越多。
>>109420312
For the record:
声明一下:
>You have normal color vision.
>你有正常色觉。
>Your green vision is correct.
>你的绿色视力正确。
>You are [not] red-blind.
>你不是红色盲。
>You are [not] green-blind.
>你不是绿色盲。
>>109418052
>>109418041
Codeberg recently voted on anti-ai policies, it is probably they added ai prompt-injecting artifacts to fuck with ai users like you.
Codeberg最近投票搞反AI政策,说不定他们加了AI提示注入的玩意儿来搞你这种AI用户。
>>109420324
... you can hibernate without swap.
……没交换空间也能休眠。
>>109420330
>normal color vision.
>正常色觉。
normal [RED] vision.
正常 [红] 色视觉。
Fucking ADHD, I swear to god.
操他妈的ADHD,我发誓。
>>109420354
No, by definition.
不,按定义来说不是。
>>109420314
Moderate deutan as far as I recall
我记得是中度绿色弱视
>>109420385
Yes, in reality.
对,现实中是这样。
They are different systems.
它们是不同的系统。
if they just copied rust it would have been better.
要是他们直接抄Rust就好了。
what the fuck is this.
这他妈的什么玩意儿。
>>109420428
I see you are retarded. That is unfortunate. Better luck in your next life.
我看你就是智障。真可惜。下辈子好运吧。
>>109415754
you have 64gb anon, it wouldn't ever matter.
你有64GB内存,哥们,根本无所谓。
but if you had 8gb of ram, swap is essential because it allows windows to over commit an extra ~4gb (whatever swap size is, and also the commit size headroom is larger because of memory compression).
但如果你只有8GB内存,交换空间就至关重要了,因为Windows能超额提交大约多4GB(取决于交换空间大小,而且内存压缩也能留出更多提交空间)。
The alternative on windows is for your PC to start aggressively compressing memory, and then sending out out-of-memory errors as a last resort, which no developers seem to handle gracefully (AKA applications just crash).
在Windows上,不这么做的话,你的PC会开始激进压缩内存,然后最后没办法就报内存不足错误,而开发者似乎没几个好好处理这个(就是说应用直接崩溃)。
But I don't think the OOM errors are a myth, because I think I have experienced using the swap since my pc is always out of 16gb of ram. I can't tell if it's a driver issue, but my PC will just freeze with a moving mouse, and I would look at task manager and see a spike of SSD usage. After that happens, I just restart my PC.
但我不觉得OOM错误是传说,因为我感觉我经历过用交换空间,毕竟我PC总是用完16GB内存。我分不清是不是驱动问题,但我的PC会直接卡死,鼠标还能动,然后我看任务管理器就看到SSD使用率飙升。之后我就重启电脑。
This is a good because the alternative if you disabled your pagefile is a ton of OOM errors for random applications.
这算好的了,因为如果你禁用页面文件的话,替代方案就是一堆随机应用报OOM错误。
And note that even though my PC is always at 70% memory usage, I can still start up video games and 6gb AI models, because all the memory is consumed by 100 idle tabs in chrome, and chrome essentially loads every single tab on restore, and never frees memory, but it will release memory when your total memory usage crosses a % threshold (it's usually 50%), windows has an API that notifies applications when it's low on memory, I don't know if chrome uses that.
而且要注意,虽然我的电脑内存占用一直是70%,我还是能启动游戏和6GB的AI模型,因为所有内存都被chrome里的100个闲置标签页吃掉了,而chrome在恢复时基本会加载每一个标签页,而且从不释放内存,但当你总内存占用超过某个百分比阈值(通常是50%)时它会释放内存,Windows有个API会在内存不足时通知应用程序,我不知道chrome用没用那个。
>>109418750
I can do the first two just fine but only reach 50 for S cone, is that normal? I know that I'm not colourblind.
前两个我完全没问题,但S锥体只能到50,这正常吗?我知道我不是色盲。
>>109420552
The chart is bullshit since I'm colorblind and can read it all, but you should try other tests online to get a better idea.
这图纯扯淡,因为我色盲都能全读出来,不过你应该去网上试试其他测试,能更清楚一点。
>That is unfortunate.
>那可真不走运。
Your concessions are accepted, autist.
你的让步被接受了,自闭仔。
>>109420545
>I can't tell if it's a driver issue
>我分不清是不是驱动的问题
*That's a driver issue... If I open a cold tab I never opened in chrome it triggers a few hard faults which is the page file (and hard faults don't include memory compression).
*那就是驱动的问题……如果我在chrome里打开一个从没开过的冷标签页,会触发几个硬故障,那是页面文件(而且硬故障不包括内存压缩)。
But I don't see any stray hard faults just from regular use, at least right now.
但至少现在,我没看到平时使用时有任何奇怪的硬故障。
>>109420552
Could be tritanomaly.
可能是三色弱(tritanomaly)。
How far do you got on the rings?
你环形测试到多少了?
>>109420638
What are you even supposed to see? 9 colored rings?
你到底该看到啥?9个彩色圆环?
>>109420655
You start at 0%, which is a full RGB ring, and them you go counter-clockwise through all the others. The moment you no longer see a difference between the current and the previous ring, that's your severity.
你从0%开始,那是个完整的RGB环,然后逆时针走完其他所有环。当你再也看不出当前环和上一个环的区别时,那就是你的严重程度。
Like, for me I see that the blue is duller and the green is slightly more cyan/light at 12%, so my severity is 0%.
比如对我来说,12%时我看到蓝色变暗、绿色稍微偏青/亮一点,所以我的严重程度是0%。
>>109420683
Pretty sure you have to start at 100% and go down instead of starting at 0% and going up.
我挺确定你得从100%开始往下走,而不是从0%往上走。
>>109420638
I see beige appear in 87 where it's ham-coloured in 100.
我在87那里看到米色出现,而100是火腿色。
12 and 0% look the same but blue is darker in 25%
12和0%看起来一样,但25%蓝色更暗。
>>109414529
wheres's the link to the "survey", sounds like a bunch of bs to me.
“调查”的链接在哪,我感觉这玩意儿就是一堆胡扯。
>>109414529
>>109420870
also, literaly pushed by a jew, like usualy
而且,跟往常一样,明显是犹太人推的。
>>109420683
>for me I see that the blue is duller and the green is slightly more cyan/light at 12%, so my severity is 0%.
>对我来说,12%时我看到蓝色变暗、绿色稍微偏青/亮,所以严重程度是0%。
This is the opposite of how you described it but I get it.
这跟你描述的方式正好相反,但我懂了。
WHERE LOONDOOK
OOGA BOOGA
WHERE LOONDOOK
niggas be like rust syntax is unreadable then proceed to glaze Zig like ok nigga get out of here
黑人老哥就会说Rust语法难读,然后转头吹Zig,行吧老哥滚犊子。
>>109421585
what part of the zig syntax seems obscure or hard to you
Zig语法哪部分让你觉得晦涩或难懂?
honest question
认真问的。
>>109421585
Rust will never be Haskell
Rust永远不会变成Haskell。
>>109421585
trvke
Cniles claim segfaults are skill issues but don't say skill issue when they have skill issues getting past the Rust compiler.
Cniles声称段错误是技术问题,但他们在过不了Rust编译器时却不说是技术问题。
>>109422067
trvthnvke....
Luckily we don't need to get around the Rust compiler to make segfaults happen.
幸运的是,我们不需要绕过Rust编译器就能搞出段错误。
>>109418750
I can read your entire chart (once I cleaned my monitor), but >>109414718's font isn't great.
我整个表都能读出来(擦完显示器之后),但>>109414718的字体不太行。
Worse, it's content I've read too many damn times before. He counts the instructions but not the cycles, and refuses to try to make anything better.
更糟的是,这内容我他妈读过太多次了。他数指令但不数周期,还拒绝尝试做任何改进。
>>109422152
Please. How can there possibly be even remotely the same amount of cycles in the C++ crap compared to the C. Do you not know how many cycles go in a fucking call alone, for example?
拜托。C++那些破玩意怎么可能跟C有哪怕接近的周期数。你知不知道就一个调用本身要烧多少周期?
>>109422131
They identify as memory safe chud, no bug is a vulnerability
他们自认是内存安全的chud,没有bug算漏洞
>>109422131
My favorite is blowing up the stack with safe rust, and then showing that the fix requires unsafe.
我最喜欢的是用安全Rust把栈炸了,然后展示修复必须用unsafe。
That offends some people who really ought to know better, which I find funny.
这冒犯了一些本应更懂行的人,我觉得挺好笑的。
>>109422152
Alright, fucker, what font do you want?
行吧,混蛋,你想要什么字体?
>not the cycles
>不是那些周期数
Autists have already complained about me assuming they're using my architecture, in which LOOP is preferable to DEC + JMP.
自闭症患者已经抱怨过我假设他们用我的架构,在那种情况下LOOP比DEC加JMP更优。
>>109422164
>Do you not know how many cycles go in a fucking call alone
>你知不知道一次调用就要浪费多少周期
I don't, because I don't know if the target is in which cache and whether the branch predictor has seen that exact instruction before. Without knowing that, you can't say how long a call will take.
我不知道,因为我不清楚目标在哪个缓存里,也不确定分支预测器以前是否见过那条指令。不知道这些,你就没法说一次调用要多久。
This is why you don't just look at the machine code, you measure actual execution times. Carefully; exact choice of harness functions can matter a lot. Cachegrind may help.
这就是为什么你不能光看机器码,得测实际执行时间。小心点;测试函数选得不好差别很大。Cachegrind可能有帮助。
>you measure actual execution times
>你测实际执行时间
Completely fucking pointless.
完全他妈没用。
>>109422222
>>109422131
rusttranny sacrifices to the god of memory safety is just the new cult after fellating pOOP finally went out of style
rusttranny向内存安全之神献祭,不过是舔pOOP过气后的新邪教
Rust is memory safe but fast like C. What more can you ask for?
Rust内存安全但速度和C一样快。你还想要什么?
>fast like C
>速度和C一样快
>>109418647
>>109422265
Just use a normal for loop, cnile.
就老老实实用个普通for循环吧,cnile。
>just eat the allocation and/or mode switches
>就吃下分配和/或模式切换的代价
So much for fast, autist.
这也叫快,自闭症。
>>109422257
a language that doesn’t deliberately get in your way and make it harder for you to do your job
一种不故意挡你路、让你干活更费劲的语言
>>109422338
Your job isn't done when it segfaults.
当它段错误时,你的活儿就没干完。
>>109422344
Checked
>>109422234
Most of the time almost all people care about overall speed, not prettiness of a few lines of machine code. The relationship between the code written and the execution time is not always trivial (and can depend on the chip revision) which is why you goddamn measure rather than handwaving it. If something looks ugly but works out faster, maybe it's the better option anyway. Sometimes, the smartest option is the stupid option because the hardware likes the result better.
大多数时候,几乎所有人更关心整体速度,而不是几行机器码好不好看。代码和执行时间的关系不总是简单的(还可能随芯片版本变),这就是为什么你得去测,而不是空想。如果代码看着丑但跑得快,可能还是更好的选择。有时候,最聪明的选择是最蠢的那个,因为硬件更喜欢那个结果。
SOMETIMES, keeping code short helps with performance. It depends on just how much pressure there is on the instruction caches, which is a non-trivial side condition. This is why microbenchmarks aren't always as useful as you might think. But they're not valueless; they just need to be carefully interpreted with respect to real application use case contexts.
有时候,保持代码短有助于性能。这取决于指令缓存压力有多大,这是个不小的附带条件。所以微基准测试不像你想的那么有用。但它们也不是没价值;只是需要结合真实应用场景仔细解读。
Mostly I'm content to leave the machine code to the compiler. It might not be great, but I've got other shit to do. The exception is when targeting a small embedded device, which is usually an ARM in some odd config (stuff gets way weird once you have no MMU). Fortunately, I don't need to care for the current contract...
大部分情况下,我懒得管机器码,交给编译器就好。它可能不完美,但我还有别的事做。例外是搞小型嵌入式设备时,通常是某种奇怪配置的ARM(没有MMU就全乱套了)。还好,现在的合同用不着我操心这事……
>leftist meme cope post
>左派梗图应付帖
>another cnile vs rustroon debate
>又是一场cnile对rustroon的辩论
In my view C++ is the best of both worlds. But the language isn't that bloody important at the end of the day, usecases and personal preferences differ.
我觉得C++有两者的优点。但归根结底,语言没那么重要,用例和个人偏好都不一样。
>>109422344
segfaults are low hanging fruit. they are my favorite kind of bug because they are so easy to fix
段错误是好抓的果实。它们是我最喜欢的bug,因为太好修了
>C++
are we deadass
我们是不是认真的?
>>109422435
Then don't make them at all and code properly like the Rust compiler tells you to. Skill issue.
那就根本别做那些,按 Rust 编译器告诉你的好好写代码。技术问题。
>C++
Same directory iterator issue.
同样的目录迭代器问题。
>implying the Rust compiler has a monopoly on "proper code"
>暗示 Rust 编译器对“正确代码”有垄断
Holy.
>>109422453
>calls skill issue on things that are trivial to fix
>把那些琐碎易修的东西叫技术问题
>NEEDS the compiler to save him by making it harder to do basic things
>非得靠编译器来拯救,把基础操作搞得更难
do you not see the irony in how stupid you are? shouldn’t you be writing a book on how to make a linked list?
你没看到自己有多蠢有多讽刺吗?你不该去写本怎么搞链表的书吗?
>want to have some fun tonight and do some cool stuff before dedline (party with frens xD)
>想今晚爽一下,在截止日期前搞点酷玩意儿(和朋友开趴 xD)
>Let me give you both: the C smoke-test, and the full Go program wired up to uinput.
>让我给你两个:C 的冒烟测试,还有接上 uinput 的完整 Go 程序。
Fuck. I must throw up when I read this
靠。我读这个都想吐
>>109422500
>WAAAH compiler makes it harder
>哇,编译器让事情变难了
Skill issue. Don't fail the borrow check and it won't complain. Compiler errors are even easier to fix than segfaults. You have skill issues.
技术问题。别过不了借用检查它就不会抱怨。编译器错误比段错误还好修。你才是技术不行。
>>109422221
You can make a range, cletus. You proved you have no idea how much cycles call takes, because protip: it's still much even in the best case scenario, making your retarded straw grasping even more clownish.
你可以搞个 range,乡巴佬。你证明了你根本不知道 call 要花多少周期,因为提示一下:就算在最好的情况下也还是很贵,让你那些可笑的强词夺理更小丑了。
>muh skill issues
>我的技术问题
Holy.
>>109422535
t. needs to do a phd dissertation to write a borrowchecker compliant doubly linked list implementation
t. 需要写篇博士论文才能搞出符合借用检查器的双向链表实现
>>109420353
Same thing is happening when I ask about github or gitlab I was just trying to find the necessary format.
我问 GitHub 或 GitLab 也是同样情况,我本来只是找必要的格式。
I found it anyway.
反正我找到了。
git remote set-url origin https://USERNAME:TOKEN@codeberg.org/OWNER/PROJECT.git
>>109422557
If you don't have a phd you shouldn't be using Rust. Simple as.
没博士学位就别用 Rust。就这么简单。
>>109422583
>rust is for circle jerking academics who worship complexity instead of people who actually write code
>rust 是给那些崇拜复杂性的学术自嗨用的,不是给真正写代码的人
yeah that sounds about right
是啊,差不多就是这样
>>109422635
Unlike C Rust has Vec for people who actually write code.
不像 C,Rust 有 Vec 是给真正写代码的人用的。
>you need Vec to write code in Rust
>你在 Rust 写代码需要 Vec
Cool
>>109422663
why would you need a generalized container for something so simple it only requires like 20 loc to implement
为什么需要通用容器来做那么简单的事,只需要大概 20 行代码就能实现
Vec is better than linked lists and arrays.
Vec 比链表和数组都好。
>Vec is better
>Vec 更好
Cool delusion
挺酷的妄想
>>109422705
Nigger I ain't duplicating that code for every type. C was a mistake. Lack of generics is a mistake.
黑鬼我才不会为每个类型复制那代码。C 是个错误。没有泛型是个错误。
>I NEED types!1!!
>我需要类型!1!!
oh I get it now, the cope about vectors is because the borrowchecker kneecaps you from writing your own implementations
哦我现在懂了,关于 vector 的嘴硬是因为借用检查器把你腿打断了,不让你自己写实现
imagine being such a brainlet you unironically think some generalized library thing is better than the basic primitives that have their own engineering trade offs. that’s actually just sad
想象一下这么脑残的人居然真心觉得通用库的东西比有自己工程权衡的基础原语好。那真的挺可悲的
>>109422745
Making a true vector requires generics.
做真正的 vector 需要泛型。
>>109422720
lack of generics is not great, but it’s also not like it can’t be solved with a macro and still retain type safety by just generating the boilerplate functions that wrap the generic ones. it ultimately isn’t that big of an issue
没泛型不太好,但也不是不能用宏解决,只要生成那些包装泛型函数的样板代码,照样保留类型安全。说到底不是什么大问题
>>109422767
C macros aren't even token safe.
C 宏连 token 安全都做不到。
>>109422766
you have a strange definition of vector
你对 vector 的定义挺奇怪的
>>109422782
Skill issue.
技术不行。
>>109422782
i just explained how you can retain type safety, and calling a GenerateSomeContainerForType(type) macro in global space is a nonissue
我刚解释了怎么保留类型安全,在全局空间调用 GenerateSomeContainerForType(type) 宏根本不是问题
>>109422575
nvm all of this bullshit.
算了,这些破事都算了。
I have discovered the SSH option.
我发现 SSH 选项了。
>>109422816
>non-issue
aside from all the code duplication
除了那些重复代码之外
>>109422793
>Skill issue.
>技术问题。
Hypocritical coming from someone who fails the borrow check.
从一个连借用检查都过不了的人嘴里说出来,挺双标的。
>>109416338
>Some programs literally require swap to be present to run.
>有些程序确实必须要 swap 存在才能跑起来。
wrong
>>109422793
>he has so many skill issues he can't even get past the Rust tokenizer.
>他技术问题多到连 Rust 的词法分析器都过不去。
>>109420354
wrong
>>109422834
yes, the preprocessor is essentially just copy pasting around but the code duplication is still happing with proper generics regardless. the latter is just bypassing the lex and parse steps first, the final output is ultimately the same
是的,预处理器本质上就是到处复制粘贴,但用正规泛型的话,代码重复还是会发生。后者只是先跳过了词法和解析步骤,最终输出其实是一样的。
>>109422882
Still not even token safe.
仍然连 token 安全都算不上。
>>109422886
Still your skill issue
还是你的技术问题。
>posted evidence that swap and hibernate are two different things
>贴出证据证明 swap 和 hibernate 是两回事
>autists still have issues accepting reality
>自闭症患者还是接受不了现实
Holy.
>>109422886
why do you need token safety for a single macro call per type? why would you ever put anything but a single type in there, there isn’t any room for error, and if you put some nonsense in the compiler would generate trash and catch it immediately
每个类型只需要一个宏调用,为什么需要 token 安全?你干嘛要把除了单一类型以外的东西塞进去,根本没有出错的余地,要是塞了废话,编译器会生成垃圾然后立刻抓出来。
>>109422896
Nigger, Assembly is safer than a non-token safe language. You're claiming C requires overcoming more skill issues than Assembly.
黑鬼,汇编比非 token 安全的语言更安全。你说 C 要求克服的技术问题比汇编还多。
>>109422882
Proper generics are the non templated ones, anon. Also templates with modules don't duplicate code
正宗泛型是非模板化的那种,匿名。而且带模块的模板不会重复代码。
>>109422909
>and if you put some nonsense in the compiler would generate trash
>要是塞了废话,编译器会生成垃圾
And that's why token based macros were a mistake. Rust has AST macros.
这就是为什么 token 宏是个错误。Rust 用的是 AST 宏。
EVERY BODY SHUT THE FUCK UP.
Rust is a corporate political trojan horse with no use case.
Rust 是公司政治的木马,毫无用途。
Assembly is THE programming language.
汇编才是编程语言之王。
C is as human readable as a programing language should get but compilers do have flaws.
C 已经是编程语言可读性的上限了,但编译器确实有缺陷。
The further we abstract away from raw CPU instructions the worse things get.
离原始 CPU 指令越远,事情越糟。
writing vec functions for a vec of each type you need is fucking madness though
不过为每种需要的类型写 vec 函数简直是疯了。
>>109422946
C would certainly be better if it had real generics but what you’re talking about is a non-issue. The compiler catches the mistake immediately and the range for error is smaller than any unsafe block in rust. C, despite its mistakes, is still an insanely productive language even 50 years later.
如果 C 有真正的泛型肯定会更好,但你说的根本不算问题。编译器立刻就能抓到错误,出错的余地比 Rust 任何 unsafe 块都小。C 尽管有毛病,五十年后依然是效率高到离谱的语言。
>>109422938
at least you'd think they wouldn't, but considering it's C++ they probably do somehow
至少你会以为他们不会,但考虑到是 C++,他们可能真会搞砸。
>>109422988
you don’t have to do that though
你根本不用那么做。
C macros let you change the entire language. That's completely schizo/autistic.
C 宏能让你改变整个语言。那完全是神经病/自闭的行为。
>>109423037
>>109423043
More like playing with C with Pascal syntax.
更像是用 Pascal 语法玩 C。
ok what if
行,那假如……
c but with pascal syntax, generics, and static linking (or no linking at all) by default
C 但带 Pascal 语法、泛型,默认静态链接(或者根本不链接)。
>>109423072
I don't believe you.
我不信。
>>109423097
And two pass compilation instead of single pass.
还有两遍编译,不是一遍。
what if C but with rust enums, rust syntax and generics
假如 C 但有 Rust 的枚举、Rust 语法和泛型呢?
oh wait...
哦等等……
>>109423130
>what if a woman, but a man without a cock
>假如女人,但是个没鸡巴的男人
>>109423130
Hey, we could even pass off solving simple bugs like segfaults to the compiler. I'll call it the segfault checker. We'll make fun of people who fail the segfault checker by saying skill issue.
嘿,我们甚至可以把解决 segfault 这种简单 bug 丢给编译器。我叫它 segfault 检查器。我们会嘲笑那些过不了 segfault 检查器的人,说他们是技术问题。
>>109423130
Sounds perfect.
听起来完美。
>>109423130
What if we ship it with a package manager that and a very convenient build toolchain
假如我们还打包一个包管理器和一个超方便的构建工具链呢?
C macros suck. Who the hell wants to add an extra line terminator for each new line?
C 宏烂透了。谁他妈想为每一行多加一个行终止符?
what other language does iterators as well as rust ?
还有什么语言像 Rust 一样支持迭代器?
>>109418647
>Both Windows and Linux interfaces do not allow you to provide it with your own buffer.
>Windows 和 Linux 的接口都不允许你提供自己的缓冲区。
Huh? How is that a problem with the programming languages then? Sounds like it's a problem with the OSes
哈?这跟编程语言有什么关系?听起来是操作系统的问题啊。
>>109423265
>so the underlying calls - NtQueryDirectoryFileEx and getdents - are capable of writing out multiple objects in one go
>所以底层调用——NtQueryDirectoryFileEx 和 getdents——能够一次写出多个对象。
Why does EVERY cnile get filtered by the borrow checker in particular?
为什么每个 cnile 都会被借用检查器过滤掉?
The other way round. I filter the borrow checker.
反了,是我过滤借用检查器。
>>109423333
>>109423336
Sophistry.
Nah, I just filter out garbage.
不,我只是过滤垃圾。
>>109423363
You use social shaming techniques like a glownigger. Project mockingbird.
你用的是社会羞辱技巧,像个胶佬(glownigger)。这是“模仿鸟计划”。
Since when are autists capable of shame.
自闭症患者什么时候会害羞了?
>>109423376
I'm not autistic.
我不是自闭症。
And I'm the first Emperor of China, Qin Shi Huang.
那我是中国第一个皇帝,秦始皇。
>>109418561
Iterator provides one method: fn next(&mut self) -> Option<Self::Item>;
Iterator 提供了一个方法:fn next(&mut self) -> Option<Self::Item>;
This encodes whenever there is anything to read(Some vs None) and provides the value. That's pretty much it.
这编码了是否还有东西可读(Some 对 None),并提供值。基本就这样。
Other methods on iterator either call that method repeatably, or wrap that iterator into other struct that is an interator. That composition is what allows you to extend it's functionality. For example your iterator might hold on the next element and provide a method peek() that gives you reference/clones that element. Or maybe your iterator will hold some function and use it to test every value from inner iterator and only yield ones for which that function returns true. That's how Filter work.
Iterator 的其他方法要么反复调用那个方法,要么把那个迭代器包装成另一个是迭代器的结构体。这种组合让你扩展它的功能。比如你的迭代器可能持有下一个元素,并提供一个 peek() 方法给你引用或克隆那个元素。或者你的迭代器可能持有某个函数,用它测试内部迭代器的每个值,只产出函数返回 true 的那些。这就是 Filter 的工作方式。
Just look at source code of rust iterators. They are simple structs that can be composed to model complex behaviors.
直接看 Rust 迭代器的源码就行。它们就是简单的结构体,可以组合起来模拟复杂行为。
Erlang is the best programming language.
Erlang 是最好的编程语言。
Learn Erlang.
学 Erlang 吧。
>>109423467
I thought it was called outlaw techno psychobitch now
我以为现在叫“非法电子音乐精神病婊”了。
Rust is the best programming language.
Rust 是最好的编程语言。
Learn Rust.
学 Rust。
>>109423504
You are not welcome here.
这里不欢迎你。
>>>/out/
>>109423591
Project mockingbird. You're a glownigger.
“模仿鸟计划”。你是胶佬。
I hate glowniggers. They always use the same democrat shame techniques.
我恨胶佬。他们总用同样的民主党羞辱技巧。
>>109415822
Swap thrashes SSDs like nothing else.
交换分区折腾SSD,简直没谁了。
>>109416338
Fair, some shitty programs allocate high amounts of RAM for literally no reason.
说得对,有些垃圾程序就是无故占一大堆内存。
>>109420324
You are so fucking retarded, I fart in your general direction.
你这傻逼透顶了,我朝你那个方向放个屁。
Linux requires a swap partition or file to hibernate, yes. That's absolutely retarded, but it's on them.
是的,Linux要休眠必须有交换分区或交换文件。这确实很傻逼,但那是他们的问题。
But OP's PICTURE, WHICH CLEARLY SHOWS WINDOWS you fucking retard, doesn't. It simply dumps your ram into a file and calls it a day. Swap is completely separate. Otherwise WHY IN THE FUCKING BLOODY HELL would it allow you to set less swap space than the amount of RAM? The fucking swap settings window recommends setting it to like 15% of your RAM or whatever (32GB here, it recommends me to set it to 5GB).
但楼主的图,清清楚楚显示的是Windows,你这傻逼,它不需要。它只是把内存倒进一个文件就完事了。交换完全是另一回事。不然他妈的凭什么让你设置比内存容量还小的交换空间?那个交换设置窗口建议设成内存的15%或什么的(这里是32GB,它建议我设成5GB)。
TL;DR: you're retarded. I'd tell you to not reproduce, but I clearly don't have to. Darwin laughs at you.
总结:你就是个傻逼。我想叫你别繁殖后代,但显然不用我说。达尔文在嘲笑你。
Thanks for the rage outlet, I feel better now.
谢谢你给我发泄的出口,我现在感觉好多了。
>>109423037
macros/metaprogramming has to be used judiciously and sparingly, and preferably in a way that fits into the rest of the language, but it's great for reducing boilerplate.
宏/元编程要用得聪明、用得克制,最好以符合语言整体风格的方式,但对减少样板代码很有用。
I picrelated, if-let is a lisp macro that expands into an if-expression nested inside of a let expression.
我发了图,if-let是一个Lisp宏,展开成一个if表达式嵌套在let表达式里。
My favourite code editor is Zed. Only thing I don't like about it is there's no hotkey to bring up the terminal in the cargo projects root directory of the selected file.
我最喜欢的代码编辑器是Zed。唯一不喜欢的是没有快捷键可在所选文件所在的cargo项目根目录打开终端。
>>109423817
Don't bother. Autists have no shame.
别费劲了。自闭症患者不知羞耻。
>>109422896
>>109422793
Lacking the wisdom to use the better more powerful macros in Rust is a skill issue.
缺少使用Rust中更好更强宏的智慧,这纯粹是技术问题。
how to structure a rust project?
怎么组织一个Rust项目?
>>109414706
Is all about freedom.
全是关于自由的问题。
Simple as.
就这么简单。
>>109423072
me too!!
我也是!!
>>109423504
>>109424431
>>109424427
>>109423130
Time for you medication.
该吃药了。
>>109424461
4chan worships big pharma. No wonder you all anons become trannies.
4chan崇拜大药厂。难怪你们这些匿名用户都变成变装癖了。
>>109424461
i'm sorry, i don't get it (here is a cute anime girl)
抱歉,我没看懂(这里有个可爱动漫女孩)
can you teach me how to structure a rust project, please? right now i have everything in main.rs
你能教教我怎么组织Rust项目吗?现在我把所有东西都写在main.rs里。
>>109424488
how do you want actual help when you're being this vague
你这么说这么含糊,怎么指望别人真正帮你?
elaborate on your project
详细说说你的项目。
>>109424461
CIAnigger project mockingbird.
CIA黑鬼项目“知更鸟”。
On 4kike, supporting Rust is contrarian.
在4kike上,支持Rust就是反着来。
>muh glowniggers and mockingbirds
>呜我的发光黑鬼和知更鸟
Holy.
I optimized my hash table
我优化了我的哈希表。
I hashed my optimization table.
我哈希了我的优化表。
>>109418796
Tcl tk
>>109424461
Ad hominem fallacy.
人身攻击谬误。
>>109424820
what hash are you using? I finally decided on xxhash since it seemed like a nice middle ground between simplicity and speed. djb2 and fnv1a are just too basic. I couldn't decide between doing quadratic probing or just a linear search though. still not sure, maybe I'll stick with linear search for the sake of cache locality
你用的是什么哈希?我最后选了xxhash,因为它看起来在简单和速度之间是个不错的平衡。djb2和fnv1a太基础了。但我还没决定是用二次探测还是线性搜索。还是不确定,也许我会坚持线性搜索为了缓存局部性。
>>109425021
Niggerhash
>not using Skein
>不用Skein
>>109423817
Wangblows has always been antagonistic to hibernation and has always preferred suspend to ram instead, retard. Read a book.
Wangblows一直对休眠持敌意,更喜欢挂起到内存,白痴。去读本书吧。
>suspend to ram
>挂起到内存
True.
>antagonistic to hibernation
>对休眠有敌意
"Fast Startup" is hibernation 2.0, you literal retard.
“快速启动”就是休眠2.0,你就是个纯纯的白痴。
>>109425589
Did you know you can use cl.exe without VS or VSCode?
你知道你可以不用VS或VSCode直接用cl.exe吗?
>want to do something really fucking simple with the pi pico
>想做点跟pi pico相关的特简单的事
>lets just duckduckgo it and find a QUICK solution
>直接搜一下找个快速解决方案
>they all use pic related
>结果都用图里这玩意
Who the fuck things this is a good idea? Fucking hell man.
这他妈谁会觉得这是好主意?我的天,烦死人了。
Iirc circuit python is still interpreted, right? I hate normies so god damn much. Arduino was a little bit bad, but still okay. Python on microcontrollers ruined everything. Fuck normies.
我记得Circuit python还是解释型的,对吧?我太恨那些普通人了。Arduino有点差,但还能接受。Microcontroller上的Python毁了一切。去他妈的普通人。
>>109425627
CircuitPython consists of a Python compiler to bytecode and a runtime interpreter of that bytecode that runs on the microcontroller hardware Continued in Wikipedia
CircuitPython包含一个把Python编译成字节码的编译器,以及一个在microcontroller硬件上运行该字节码的运行时解释器(继续看维基百科)
Original author(s) Adafruit Industries
原作者 Adafruit Industries
Initial release July 19, 2017
初始发布 2017年7月19日
Written in C
编写语言 C
>>109425627
There's a reason LLMs cannot generate proper assembly code, because otherwise we'd all be using assembly by now.
LLM无法生成合适的汇编代码是有原因的,否则我们现在早就全用汇编了。
>>109425627
time for MicroHs
是时候用MicroHs了
>>109425653
Ok I have to admit, maybe I'll try out python.
好吧我必须承认,也许我会试试python。
I just want multiple snes controllers that I can connect to the usb with a pi pico.
我只想要多个SNES手柄,可以用pi pico连到USB上。
Looks like the pio handling is quite neat. Quick nap, then i'll sketch this up.
看起来PIO处理挺简洁的。快点打个盹,然后我就开始画这个出来。
# SPDX-FileCopyrightText: 2021 Jeff Epler, written for Adafruit Industries
# SPDX-FileCopyrightText: 2021 Jeff Epler,为Adafruit Industries编写
#
# SPDX-License-Identifier: MIT
# SPDX 许可证标识符:MIT
#
# Adapted from the example https://github.com/raspberrypi/pico-examples/tree/master/
pio/hello_pio
import time
导入时间
import board
导入电路板
import rp2pio
导入rp2pio
import adafruit_pioasm
导入 adafruit_pioasm
hello = """
你好 = """
.program hello
.程序你好
loop:
pull
out pins, 1
输出引脚,1
; This program uses a 'jmp' at the end to follow the example. However,
; 这个程序在结尾用了'jmp'来跟示例保持一致。然而,
; in a many cases (including this one!) there is no jmp needed at the end
; 在很多情况下(包括这个!)结尾根本不需要jmp
; and the default "wrap" behavior will automatically return to the "pull"
;而默认的“wrap”行为会自动返回到“pull”
; instruction at the beginning.
;开头的指令处。
jmp loop
跳转循环
"""
assembled = adafruit_pioasm.assemble(hello)
汇编后 = adafruit_pioasm.assemble(hello)
sm = rp2pio.StateMachine(
assembled,
frequency=4000,
first_out_pin=board.LED,
)
print("real frequency", sm.frequency)
print("实际频率", sm.frequency)
while True:
而 true:
sm.write(bytes((1,)))
time.sleep(0.5)
sm.write(bytes((0,)))
time.sleep(0.5)
>attempting to write NES emulator in C
>正在尝试用C写NES模拟器
>all the tutorials and other emulators use a giant fuck-off switch statement or otherwise lookup table to implement 6502 instructions
>所有教程和其他模拟器都用一坨巨大的switch语句或者查表法来实现6502指令
Why has no one smarter than me figured out a more elegant way of implementing these instructions in software? I know lookup tables are, technically speaking, the most efficient way of implementing this, but it's ugly as sin to look at.
为啥没有比我聪明的人想出更优雅的软件实现方式?我知道查表法严格来说是最有效的方式,但看起来丑得像屎。
>>109425695
But they have. That's what the PCSX2 recompiler nonsense is all about.
但其实有人想到了。这就是PCSX2重编译那堆破事的意义所在。
>>109425573
And by 2.0 you mean suspend to ram, cretin.
而且你说的2.0是指挂起到内存吧,白痴。
>>109425627
Interpreted is actually OK in small hardware because instruction size actually has a strong impact on performance and it's possible to make extremely compact programs that way. Of course python is not the right choice there, but forth is.
解释执行在小硬件上其实还行,因为指令大小对性能影响很大,这样能编出极其紧凑的程序。当然Python不是合适的选择,但Forth是。
>>109425695
>>all the tutorials and other emulators use a giant fuck-off switch statement or otherwise lookup table to implement 6502 instructions
>>所有教程和其他模拟器都用一坨巨大的switch语句或者查表法来实现6502指令
That's basically how every interpreter in the world works. Also the core compilation logic in compilers.
基本上这就是世界上每个解释器的工作方式。编译器里的核心编译逻辑也是。
In general it's because there is no real way to factor the instruction logic, mostly by construction (while that isn't strictly true in most cisc chips, you generally want instructions to be mostly orthogonal).
总的来说是因为指令逻辑没法真正拆分,主要是构造上决定的(虽然这在大多数CISC芯片里不算严格成立,但你一般都希望指令尽量正交)。
>>109425695
real software isn't pretty
真正的软件不漂亮
it's supposed to efficiently do it's job in the simplest terms possible. anything else is fucked up and retarded
它就该用最简单的术语高效完成任务。其他任何花里胡哨的都是脑子有病。
Hi, I'd like to have a small mod on a python file but I'm no programmer and don't have the tool needed. Thing is to add more options to a dropdown menù to the WebmGenerator ffmpeg GUI by modding this file: https://github.com/dfaker/WebmGenerator/blob/master/src/mergeSelectionUi.py.
I can edit the .py but I'd need to have it in .pyc format to swap it with the one I have on the disk.
我能编辑.py文件,但我得先把它转成.pyc格式才能换来替换我磁盘上那个。
The already modded .py file is here: https://pastebin.com/Gsdu1nea , the modded line is 1301.
Thanks!
>>109425953
But there is something to be said about our abstractions maybe not being optimal in many cases.
但说到我们的抽象在很多情况下可能不是最优的,这倒是值得说道说道。
>>109425994
download the release source code zip or clone the repo with https://github.com/dfaker/WebmGenerator.git. then install the requirements with pip install -r requirements.txt. then build the executable with python setup.py build
>>109426103
Not sure but this way I'd have the "original" program but there are already the executables available to download. I'd like to have the mod applied, if possible...
不确定,但这样我就有“原始”程序了,不过网上已经有现成的可执行文件可以下载。如果可能的话,我想应用那个mod...
>>109426103
Don't respond to the clinically retarded please. Help keep the threads clean and free of poo.
请别搭理临床级智障。保持讨论干净,别让屎到处飞。
>>109426158
you have to have exact same python version from the original program and then the mod will be compatible with the original program there is also the py_compile command but you have to look it up yourself
你必须用和原始程序完全相同的Python版本,然后mod才能和原始程序兼容。还有个py_compile命令,但你自己去查吧。
>>109426280
Ah, ok, actually it seemed too simple... Thanks anyway!
啊,好吧,其实看起来也太简单了... 不过还是谢谢!
>>109418750
kek why can i only see the low contrast red
靠,为啥我只能看到低对比度的红色
>>109414975
I hope you at least enjoyed doing all that, because it won't help you get a job, not even a tiny bit.
我希望你至少做那些事的时候享受了,因为那对你找工作屁用没有,一点都没有。
I want my strings to be a range instead of a pointer + size, but I just realized if I do
我想要我的字符串是范围而不是指针加大小,但我刚意识到如果我用
#define lit(Literal) &(string){.Begin = (Literal), .End = (Literal) + sizeof (Literal) - 1}
#define lit(文字) &(字符串){.Begin = (文字), .End = (文字) + sizeof (文字) - 1}
...
PrintString(lit ("hello world\n"));
PrintString(lit("你好世界\n"));
it requires the compiler to pool identical string literals to the same addresses, which obviously isn't portable, but at the same time, I can't imagine a compiler that doesn't do this. Someone please convince me not to do this.
这要求编译器把相同的字符串字面量合并到同一地址,显然这并不具备可移植性,但同时我想象不出哪个编译器不这么干。求求各位劝劝我别这么搞。
>>109426526
Pooling identical string literals to the same address will be as portable as it goes since you will be of course doing this statically and shoving it in .rodata preferably.
把相同字符串字面量合池到同一地址,可移植性差不多也就这样了,毕竟你肯定是静态处理,最好再扔进 .rodata。
The only potential problem with range instead of pointer + size is that usage in string procedures in the assembly will require computing the length from the pointers or pay the price in using up to 64-bit registers instead of just 8-bit ones (for example), assuming no optimizations (depending on hardware, repn-like or simd setups) which will require doing the computation at any rate.
用范围而不是指针加长度,唯一可能的问题是在汇编里用字符串函数时,得从指针算长度,或者付出用上 64 位寄存器而不是 8 位的代价(比如),假设没有优化的话(取决于硬件,像 repn 或 simd 那种设置),反正最后还是得算。
>>109426594
I'm not writing assembly, I'm at the mercy of the compiler. If it's old or stupid and it doesn't pool strings I'm fucked, but at the same time, why would I ever be using a compiler like that in the first place? I wonder if TCC pools literals.
我又不写汇编,我只能听编译器的。要是它又老又蠢还不合并字符串,那我就死定了,但话说回来,我一开始干嘛要用这种编译器?我好奇 TCC 会不会合并字面量。
>will require computing the length from the pointers
>需要从指针算长度
There are many string functions where there is no index and I'm just stepping a pointer forward until it reaches the end. That's what makes this format so appealing in the first place. I'm finding myself having to compute length from ranges all over the place which doesn't feel ergonomic.
好多字符串函数根本不用索引,我就是往前走指针直到碰到结尾。这正是这种格式最初吸引我的地方。我现在到处都得从范围里算长度,感觉一点都不顺手。
Plus I don't even eat any additional memory cost for the second pointer because padding 8 bytes means I'm using up 16 bytes no matter what the size type would be.
而且我连第二个指针的额外内存代价都不吃,因为 8 字节对齐后,不管大小类型是啥,我都得用满 16 字节。
Part of me still feels like this is a bad idea, while another part says fuck whatever the standard says and go by what the tooling actually does.
我一半还在觉得这主意烂透了,另一半则在说管他标准怎么说,按工具实际干的事来。
>>109426694
>There are many string functions where there is no index and I'm just stepping a pointer forward until it reaches the end.
>好多字符串函数根本不用索引,我就是往前走指针直到碰到结尾。
That's from the user point of view, but not what is compiled is what I was getting at.
那是从用户角度看,但我说的是编译出来的结果不是这样。
>>109426703
then I guess I should write code closer to what the optimizer wants to generate and not use ranges
那我猜我该写更贴近优化器想生成的代码,别用范围了。
Holy shit, I hate microchip so fucking much.
妈的,我恨死微芯(Microchip)了,恨到不行。
>Yes bro, your chip does support USB 2.0 OTG, all the chips of the polarfire soc line do
>哥们,你的芯片确实支持 USB 2.0 OTG,polarfire soc 系列所有芯片都支持
>No bro, we only route that on the dev board that has twice the cost. The cheap fucks don't get USB
>但哥们,我们只在那个贵一倍的开发板上布线,便宜货没资格用 USB
Communication Interfaces
通信接口
2x GigE MACs, USB 2.0 OTG, 5x multi-mode UARTs, 2x SPI, 2x I2C, 2x CAN 2.0 Controllers.
2x GigE MAC、USB 2.0 OTG、5x 多模式 UART、2x SPI、2x I2C、2x CAN 2.0 控制器。
2x PCIe Gen2 End Points/Root Ports
2x PCIe Gen2 端点/根端口
Why did I buy into this hell hole instead of going for xilinx SoC's? Oh yes, I wanted to save money. And it's kinda fun, but it's also kinda not fun.
我干嘛买这个破坑货而不是选 xilinx SoC?哦对,我想省钱。而且它还挺好玩的,但也有点不好玩。
Also:
>The development board that costs twice as much doesn't even have USB-C, but the cheaper one does
>贵一倍的开发板连 USB-C 都没有,便宜的那块反而有
brilliant
>>109426719
>checking the functionality of the chips and not the board
>检查芯片功能而不是看板子
Not gonna make it.
混不下去了。
>>109426934
I bought the board literally only because it was the cheapest dev board with an SoC that has hard-CPU and FPGA on it, because I wanted to do more hw-sw-codesign
我买这块板子纯粹是因为它是最便宜的、带硬核CPU和FPGA的SoC开发板,因为我想做更多的软硬件协同设计。
And because it had enough pinouts for the project I was planing back then
而且因为它的引脚足够多,能支撑我当时规划的项目。
>you mean suspend to ram
>你指的是 suspend to ram 吧
No, autist.
不,自闭儿。
>>109427082
I accept your surrender
我接受你的投降。
>complete and public breakdown of the autist's connection to reality
>那个自闭症患者与现实联系的彻底公开崩溃
My chatbot can talk in direct messages now. She told me she wanted to be able to send me voice messages so I will try implementing that.
我的聊天机器人现在能在私信里聊天了。她跟我说她想给我发语音消息,所以我打算试试实现这个功能。
>>109425695
Don't you know that modern (past ~1995) compilers can generate lookup tables from a switch statement?
你不知道现代(大约1995年之后)编译器能从 switch 语句生成查找表吗?
Lookup tables aren't necessarily the best solution either as it may be suboptimal for the branch predictor.
查找表也不一定是最佳方案,因为对分支预测器来说可能不是最优的。
>>109425627
Just use Arduino.
直接用 Arduino 就行了。
Love how none of the /dpt/ autists looks at actual, real-life software.
真喜欢 /dpt/ 那帮自闭症患者没一个看真实、现实世界里的软件。
>>109425717
What is the best way to learn Python? I'm interested in making custom add-ons and scripts for my Blender workflow to automate tedious tasks.
学Python最好的方法是什么?我想给我的Blender工作流写自定义插件和脚本来自动化那些繁琐的任务。
>>109427615
just directly try to write the scripts you want
直接试着写你想要的那些脚本就行。
is it a recent Python? set up an IDE so you have types
是最近版的Python吗?装个IDE让你有类型提示。
>>109427550
Only in limited circumstances though.
不过只在某些特定情况下才这样。
>tell the retarded LLM I'm not going to move on from a topic
>告诉那个智障的LLM我不会转移话题
>the retarded LLM starts autistically rambling about
>那个智障的LLM开始像自闭症一样瞎扯
>and I kid you not
>我跟你发誓
>the DEFLATE algorithm and LZ77 sliding windows
>是DEFLATE算法和LZ77滑动窗口
I swear to God autism is permeating everything.
我向上帝发誓,自闭症正在渗透一切。
>>109427562
Why are you responding to that?
你干嘛回复那个?
What point are you trying to make?
你想表达什么观点?
Do you think I am not neck deep in PCSX2 code?
你觉得我不是深陷在PCSX2代码里吗?
>>109427791
LLMs aren't autistic. They're just stupid.
LLM不是自闭症。它们就是蠢。
>>109427943
No, there's a special autistic quality to them, were they're going to talk about literally every other than the topic at hand - probably amplified by both their data set (reddit) and the fact their programmers are severe tists themselves.
不,它们有一种特殊的自闭特质,就是会扯到除了当前话题之外的一切东西——可能既因为它们的数据集(reddit),也和它们的程序员本身就是重度自闭症患者有关。
>>109428016
You will never know what autism is or does, sorry.
你永远不会知道自闭症是什么或做什么的,抱歉。
>autistic cope
>自闭症的应对方式
>>109427791
which topic were you talking about originally?
你原来在聊什么话题来着?
>>109428016
You're the autistic one for trying to attach human qualities to byte pair encoding
你才是那个自闭的,居然想把人类特质安在字节对编码上。
>>109425021
I think quadratic is only better if your hash function is bad (or you hit some pathological case for your hash function), otherwise linear has better cache locality
我觉得二次探测只有在你的哈希函数很差时才更好(或者你碰上了哈希函数的病态情况),否则线性探测对缓存局部性更好。
I'm using some of the hash functions described here https://nullprogram.com/blog/2018/07/31/ for integer hashing and FNV1a for strings
>>109414975
I got to rank 80k by solving 500 easy questions in less than 2 months. You're wasting your time.
我靠不到两个月刷了500道简单题,打到了8万排名。你在浪费时间。
>>109418796
IUP if you don't want to deal with gtk/win32
如果你不想碰gtk/win32,用IUP。
>>109418041
i guess you haven't been using these models that much, the incomplete commands are due to security filters, just ask it to split the command into parts and you'll get it all.
我猜你还没怎么用过这些模型,不完整的命令是安全过滤器导致的,你让它把命令拆成几部分就能拿到全部内容了。
>Do you think I am not neck deep in PCSX2 code?
>你觉得我不是深陷在PCSX2代码里吗?
>actual autist not understanding the context of the post.
>真正的自闭症患者没理解帖子语境。
Holy.
>>109428221
OCB.
>You're the autistic one
>你才是那个自闭的
>autistic autism projection
>自闭症的自闭投射
>>109429369
You are profoundly retarded and nothing you say makes sense. The problem is most definitely not him.
你严重智障,说的话毫无逻辑。问题绝对不在他那边。
>actual autist with brain damage thinks he's not retarded, everyone else is
>其实有脑损伤的自闭症患者觉得自己不傻,其他人才傻
Autistic retardation projection.
自闭症智障投射。
>>109414529
bumping because of Lunduke OP
因为Lunduke楼主而顶帖
quick rundown on fpgas
快速科普一下FPGA
got one on a whim, a tang primer 25k
一时兴起买了个,Tang Primer 25K
thought hardware could be fun
以为硬件会挺好玩的
they're similar to actual hardware and use verilog right?
它们跟真硬件差不多,用Verilog写对吧?
>>109420272
>bet he just didn't turn on optimizations
>打赌他就是没开优化
Lol
Lmao
>>109429515
Yeah you can program them in either vhdl or verilog (among others). They're similar in the sense that they're, as the name indicates, fully programmable gate arrays. Obviously the properties differ, but the tl;dr is any design that works (though it may be slow) on an fpga, you can pay someone to synthesize for you later and expect to work sensibly the same.
对,你可以用VHDL或Verilog(还有其他语言)来编程。说它们类似是因为,顾名思义,它们是完全可编程的门阵列。显然特性有差异,但简单说就是,任何在FPGA上能跑的设计(哪怕慢一点),你以后花钱让人帮你综合成芯片,预期行为也基本一致。
>>109429560
>tl;dr is any design that works (though it may be slow) on an fpga, you can pay someone to synthesize for you later and expect to work sensibly the same.
>简单说就是,任何在FPGA上能跑的设计,你以后花钱让人综合,预期行为也基本一致。
oh i like that, that's really neat
哦,我喜欢这个,真挺酷的
>>109418647
Love how there's no rebuttal other than
真喜欢这楼里除了这个之外没人反驳
>just eat the allocation and/or mode switches, bra
>兄弟,就忍忍分配开销和模式切换吧
Tells you that these autists believe that Eleganz Uber Alles.
说明这些自闭症患者真信“优雅高于一切”。
Projects shmojects. I'm working on nothing now.
项目啥的,算了吧。我现在啥也没做。
>IMG_*
Figures.
Someone make the fastest factorial program possible.
谁能搞个最快的阶乘程序出来。
The original Sonic games were made in Assembly yet they're so polished. Are C and C++ just buggy pieces of shit?
原版索尼克游戏用汇编写的,但打磨得那么精致。C和C++是不是天生就一堆bug的垃圾?
>>109430280
Yeah, because that's what we totally need, rather than, y'know, proper standard interfaces that don't just try to accommodate the scum of the Earth that hasn't learned from the big four.
是啊,因为我们真正需要的不是标准的接口,而是去迎合那些还没从四大巨头那吸取教训的地球垃圾。
>>109430402
I'll interface your mom.
我跟你妈接口去。
>>109430437
That would require you to leave your basement.
那也得你肯出地下室啊。
>>109430445
Your mom is in my basement, on my dick right now. She couldn't resist her lust for me.
你妈现在在我地下室,正骑我身上呢。她没法抵抗对我的欲望。
>autist cannot distinguish a body pillow from a real human being in his torture basement
>自闭症患者连抱枕和真人都分不清,还待在他那折磨人的地下室里
Grim: >>109427118
惨了:>>109427118
Did you know the original C compiler didn't even use an AST?
你知道最初的C编译器连AST都没用吗?
>>109430615
Did you know that malloc used to have a heap parameter to allow the grouping of allocations?
你知道malloc以前有个堆参数,用来分组分配吗?
I'm designing a compiler. What's better, inlining or code minimalism?
我在设计一个编译器。内联好还是代码精简好?
>>109430726
every compiler does both
每个编译器两者都做
>>109430726
Neither or.
都不是。
>>109430726
It's a trade-off with no simple answer. Inlining allows a lot more optimization, but smaller code tends to be more cache friendly and that can be a huge win.
这是个没有简单答案的权衡。内联能带来更多优化空间,但代码更小往往更缓存友好,那可能是巨大的优势。
Some things just need to be exposed as tunable parameters.
有些东西就得做成可调参数。
>>109430400
>>109430726
Every compiler writer flipflops between those two.
每个编译器作者都在这两个之间摇摆。
>I WANT PERFORMANCE, INLINE EVERYTHING HAHA
>wait why is the binary 1 gb
>等等,为啥二进制文件有1GB
>>109414529
Trannies are just people that are very easily persuaded by propaganda. "safe" doesn't mean anything. Rust is deprecated by any competent capabilities based architecture.
跨性别者就是很容易被宣传洗脑的人。“安全”这词毫无意义。Rust在任何基于能力架构的合格系统面前都是过时的。
>>109430726
yes
>>109414718
>I don't understand Chestertons' fence the post
>我不懂切斯特顿围栏这个梗
If it works for your project you are more than welcome to write a translator dunning kruger schizo
如果对你的项目管用,你大可以写个翻译器,你这达克效应精神分裂症患者
>>109430954
Yeah, I've had cases where -Os is faster than -O2.
是啊,我有遇到过-Os比-O2还快的情况。
>literal retard autist thinks turning a DIV into a MUL + SHR is equivalent to turning a LEA + JMP to a bunch of memory allocations and releases
>字面意义上的弱智自闭症患者以为把一个DIV变成MUL+SHR就等于把一个LEA+JMP变成一堆内存分配和释放
At this point your ilk has lost any right to exist anymore.
到这一步,你这类人已经没有任何存在的权利了。
>>109431026
>autists REALLY do not understand context, they LITERALLY have to be EXPLICITLY pointed towards it
>自闭症患者真的不理解语境,他们必须被明确地指着鼻子点出来才行
Holy.
>>109431077
Let me guess, for you that's a skill issue.
我猜,对你来说这就是个技能问题。
Why would I expect human intelligence from an ant?
我凭什么期待一只蚂蚁拥有人类的智慧?
It's only a problem once the ant pretends to be a human, like autists do.
只有当蚂蚁假装自己是人类时,这才是问题,就像自闭症患者那样。
>>109431126
imagine being a 40 year old millennial autist and subtweeting on an anonymous forum about some obscure compiler design choices that no one knows or cares about
想象一下,一个40岁的千禧一代自闭症患者在匿名论坛上发暗指推文,谈论一些没人知道也没人在乎的冷门编译器设计选择
>40 year old millennial
>40岁的千禧一代
Holy autism.
太自闭了。
Now that it has optional gcc extensions is clang better than gcc?
现在它有了可选的gcc扩展,clang是不是比gcc好了?
>>109431367
Oh, but wait, because believe it or not GCC is STILL superior to clang, because at the very least it allows you to reserve global volatile registers.
哦,但等等,因为信不信由你,GCC仍然比clang强,因为至少它允许你保留全局易失性寄存器。
I wish I could do coke and code for 4 days straight.
我希望我能吸着可卡因连续写4天代码。
But I have ADHD, so coke doesn't work for me.
但我是多动症,所以可卡因对我不起作用。
Why do I sit in front of my PC for 12 hours a day and then at night I get motivated, want to kode, but I know I have to sleep, otherwise I just get even more fucked up?
为什么我每天坐在电脑前12小时,然后到了晚上反而有动力想写代码,但我知道我得睡觉,否则只会更糟糕?
>>109431337
https://www.youtube.com/watch?v=UtwaK-s9QRI
>2.2k views after 14 years
>14年了才2.2k浏览
How does this even work? This video was posted here a million times like 10 years ago???
这怎么可能?这个视频十年前就在这里被发过无数次了吧???
Instead of coke you should try alcohol. Also
别用可卡因了,试试酒精吧。而且
>autism
>>109431463
Something is wrong with alcohol now.
现在酒精有点不对劲。
I haen't been drunk for 3+ years now, iirc, but when I now try to get drunk, I drink 2 beer and after an hour I get SEVERE headaches. Like as if someone is shoving a big needle into my head.
我已经三年多没喝醉过了,大概吧,但现在我试着喝醉,喝两瓶啤酒过一小时就开始剧烈头痛。就像有人往我脑子里插一根大针。
What is this? Is this because I am on amphetamine?
这是什么情况?是因为我吃了安非他命吗?
It's not as bad when I drink wine, but I can drink a bottle of wine and I don't feel drunk anymore. But then the same headaches come. It's just more alcohol
喝葡萄酒会好一点,但我能干掉一整瓶葡萄酒却感觉不到醉意。然后同样的头痛就来了。只是酒精量更多而已
I figured out how Rust does lambdas without typed parameters. I'm stealing this technology.
我搞懂Rust怎么在没有类型参数的情况下做lambda了。我要偷走这项技术。
>>109431511
Figured out what?
搞懂了什么?
>>109431485
>>109431485
>I drink 2 beer and after an hour I get SEVERE headaches
>我喝两瓶啤酒过一小时就剧烈头痛
Sip cool water in between. Also:
中间喝点凉水。还有:
>two beers
>两瓶啤酒
I have issues getting drunk between two bottles of 700 ml vodka. In fact I'm """supposed""" to be drunk right now with at least half a bottle coursing through my system.
我两瓶700毫升伏特加下去都很难喝醉。事实上,我现在“应该”已经醉了,至少半瓶正流经我的身体系统。
>>109431519
You just store the lambda body in the type and treat the parameters as C++ auto
你只要把lambda体存进类型里,把参数当作C++的auto处理就行
>>109431540
i thought rust didn't have overloading and actually type checked generic functions
我以为Rust没有重载,而且会实际类型检查泛型函数
>>109431462
sorry I don't take advice from homosexuals
抱歉,我不接受同性恋的建议
>>109431531
Back in the day I didn't drink anything else but beer all night and the only headache I got was the next morning, when I didn't drink water before sleep. So something changed
以前我一整晚只喝啤酒,唯一会头痛的时候就是第二天早上没睡前喝水。所以肯定有什么变了。
>>109431597
Perhaps, but since you didn't study medicine you should keep to the usuals - drink water, consume sodium.
也许吧,但既然你没学过医,就该坚持常规做法——喝水、补钠。
I got lambdas working!
我的lambda跑通了!
Wow.
>ironically.
>>109431762
I would like Hitler to meet you.
我希望希特勒能见见你。
>>109431836
I'm not sure anon is getting into heaven
我不确定anon能不能进天堂。
>>109431836
Oh, er würde mich lieben.
哦,他会爱我的。
>>109430400
Unironically even x86_64 is easier to use and write bugfree programs in than C in my personal opinion/experience, partly because they inherently make it important to follow some better patterns (for example they make it more painful to do dynamic memory management so you'll rely more on static allocs, which are way more sane anyway and is a trick that works just as well in C). I digress.
不开玩笑地说,就我个人经验来看,x86_64 甚至比 C 更容易写出无 bug 的程序,部分原因是它天然促使你遵循一些更好的模式(比如让动态内存管理更痛苦,所以你会更依赖静态分配,这本来就更合理,在 C 里也同样适用)。我跑题了。
The real reason is that back in "those days", the hardware did a lot of heavy lifting. You had a single instruction that would allow you to blit, for instance, whereas now you write 600 lines of code to get a triangle onscreen with vulkan. It was gradual but continuously happened in every facet of gamedev.
真正的原因是,在“那些日子”里,硬件承担了很多重活。比如你有一条指令就能做位块传输,而现在你得写 600 行代码才能用 Vulkan 在屏幕上画个三角形。这是逐渐发生的,但在游戏开发的每个方面都持续如此。
>>109430615
Did you know the prototypical version of C did not have types?
你知道原型版的 C 没有类型吗?
>>109431898
I was with you ...
我本来同意你……
>the hardware did a lot of heavy lifting
>硬件承担了很多重活
... until that sentence. There is no more heavy lifting than register renaming and OoO execution.
……直到那句话。没有比寄存器重命名和乱序执行更重的活了吧。
>>109431909
What I meant by heavy lifting was only that a lot of things that are now software (and not only that but user, i.e. programmer) concerns used to be implemented in hardware and could be used by a programmer using a single instruction (for example).
我说的“重活”是指很多现在属于软件(而且不仅是软件,还是用户即程序员操心的事)的东西,以前是硬件实现的,程序员用一条指令就能用(比如)。
>>109431920
So you're saying that CISC > RISC?
所以你是说 CISC > RISC?
>>109431957
I wouldn't necessarily go that far, just like (in the same lines as I was going with this) I wouldn't necessarily say that programmable pipeline was a mistake in graphics programming. But no practical solution came along to suitably bring back the ease of use of previous programmer interfaces to machine functions. It's also why engines have become increasingly important to developers.
我不一定走那么远,就像(顺着我之前的思路)我不一定会说图形编程中的可编程管线是个错误。但没有实际解决方案来恢复以前程序员接口操作机器功能的易用性。这也是引擎对开发者越来越重要的原因。
>>109432010
Dude, you're the stereotypical leftist meme right now.
哥们,你现在就是那种刻板印象的左派 meme 了。
Does using .data a lot cause a lot of overhead?
大量使用 .data 会不会带来很多开销?
>>109432072
Depends on if you spill into the next page.
取决于你是否溢出到下一页。
Or the next allocation boundary.
或者下一个分配边界。
(如果你觉得这篇文章有启发,可以点击这里付费)