The Moisrex Profile Banner
The Moisrex Profile
The Moisrex

@the_moisrex

1,959
Followers
3,243
Following
1,321
Media
11,847
Statuses

Networking engineer, C++ Programmer, Uses Linux by default. Working on my own open source Web Framework / Web Server. See my Github Page for more details.

Joined June 2017
Don't wanna be here? Send us removal request.
@the_moisrex
The Moisrex
6 months
You just ruined switch-statements for me.
Tweet media one
89
151
2K
@the_moisrex
The Moisrex
5 months
JavaScript Developers don't have the "performance" mindset at all; things just work in magical ways.
Tweet media one
62
48
1K
@the_moisrex
The Moisrex
4 months
Is it a good idea to have one file per function?
Tweet media one
466
26
919
@the_moisrex
The Moisrex
4 months
You can use C/C++'s pre-processors as a template engine for HTML!
Tweet media one
29
54
726
@the_moisrex
The Moisrex
7 months
Rust guys said "C++ is unsafe" so much that Google's AI now thinks it's unsafe for children and refuses to help you out if you're under 18 😬🤦‍♂️🤦‍♂️
8
47
478
@the_moisrex
The Moisrex
2 years
@alirezashirazi کافیه رنج آی‌پی‌های ایران رو با لیست آی‌پی‌های سایت‌هایی که نیم‌بها استفاده میشن رو cidr کنی (که کار سختی نیست)، بعد روی روتری مثل میکروتیک بری لیست آدرس ایران بنویسی، بعد درخواست ها به آی‌پی های ایران رو از اینترنت معمولی، و بقیه درخواست ها رو از استارلینک یا وی پی ان رد کنی.
2
20
284
@the_moisrex
The Moisrex
6 months
@JakeArkinstall Turns out switch-statements are a fancy goto's just like everything else :)
5
0
241
@the_moisrex
The Moisrex
5 months
We now have a library to write unsafe code in Python. And yet, some idiots are making C++ safer! 😁
Tweet media one
7
25
232
@the_moisrex
The Moisrex
2 years
@alirezashirazi فقط یه نکته داره که اونم اینه که دولت اگه واقعا بخواد، میتونه نرم افزار های داخلی رو مجبور کنه یه درخواست کوچولو و ناقابل همراه با شماره تلفن به یه سایتی که سرورش خارجه بزنن. به همین سادگی میشه پیدا کرد استفاده کننده رو.
6
11
162
@the_moisrex
The Moisrex
1 year
Oh wow, this joke is actually true! 🙃
Tweet media one
Tweet media two
6
17
164
@the_moisrex
The Moisrex
2 years
Tweet media one
1
15
154
@the_moisrex
The Moisrex
9 months
Tweet media one
@lemire
Daniel Lemire
9 months
C23: a slightly better C One of the established and most popular programming languages is the C programming language. It is relatively easy to learn, and highly practical. Maybe surprisingly, the C programming language keeps evolving, slowly and carefully. If you have GCC 23 or
Tweet media one
48
159
844
4
29
147
@the_moisrex
The Moisrex
1 year
Without AI: - 4hrs of code - 4hrs of debugging With AI: - 5 mins of AI - 2hrs of debugging AI - 1 mins of deleting everything - 4hrs of code - 4hrs of debugging
1
22
140
@the_moisrex
The Moisrex
2 years
@Digiato من برنامه‌نویس به شخصه به هیچ وجه از چنین اینترنتی استفاده نخواهم کرد. ما برنامه‌نویسا فقط برای دور زدن فیلترینگ نیست که از وی‌پی‌ان استفاده میکنیم، برای دور زدن تحریمای اون ور هم هست. فیلترینگ چه باشه چه نباشه ماها بالاخره باید وی‌پی‌ان استفاده کنیم.
2
4
119
@the_moisrex
The Moisrex
1 year
Here's C++:
Tweet media one
@tawnniee
tawny
1 year
Rust bros i don't feel so good
Tweet media one
52
151
2K
7
24
127
@the_moisrex
The Moisrex
1 year
@balemessenger ما که مطمئنیم مردم «عزیزی گل» و «اها» و «اوک» رو گزارش نمی‌کنن، پس یعنی اون «الگوریتم خودکار»ی که اون بالا گفتین در این حد بی‌خاصیت هستش که این‌ها رو هم فلگ کرده؟ بعد تو عکس که idها همه هست، دیگه گفتن اینکه اطلاعات خصوصی و آی‌دی و شماره فرستنده مشخص نیست دیگه چیه؟
Tweet media one
1
0
108
@the_moisrex
The Moisrex
3 months
No, it's Microsoft and CrowdStrike's fault. People are always quick to make it C++'s fault; from what I've read so far, it's the lack of tests, engineers being lazy, and also the need for more performance that made them hand-craft stuff instead of using battle-tested utilities.
@Perpetualmaniac
Zach Vorhies / Google Whistleblower
3 months
Crowdstrike Analysis: It was a NULL pointer from the memory unsafe C++ language. Since I am a professional C++ programmer, let me decode this stack trace dump for you.
Tweet media one
3K
21K
103K
11
10
109
@the_moisrex
The Moisrex
4 months
Did utf-8 need to be this complicated in C++?!
Tweet media one
11
6
109
@the_moisrex
The Moisrex
1 year
@alirezashirazi واقعا یه جاهایی غیرقابل تحمل شده. سایت باز میکنیم بدون وی‌پی‌ان تحریمیم، با تور باز میکنیم، کلودفلر گیر میده، با وی‌پی‌ان باز میکنیم سایتای ایرانی باز نمیشه، route مینویسیم که سایتای ایرانی از تو وی‌پی‌ان رد نشه، خود وی‌پی‌انو میزنن، ۲ ساعت میگردی وی‌پی‌ان جدید، لیمیت داره، و ...
0
3
92
@the_moisrex
The Moisrex
2 years
@d3c0der البته تا اونجایی که چک دارم توضیح درست‌تر اینه که با extract کردن فایل archive، فایل payload رو میریزه توی آدرس وب سرور، بعد از طریق وب میشه اجراش کرد. اینم به خاطر یه باگ قدیمیه که توی cpio هست که اگه روی دیسترویی (مثل ubuntu) باشین که pax نصب باشه، zimbra از اون استفاده میکنه.
1
3
82
@the_moisrex
The Moisrex
4 months
Look, we can now set a breakpoint in our code in C++26. No compiler yet supports this, but it shouldn't be hard to implement since all of them support some custom way of doing this already; like __builtin_debugtrap in llvm. JavaScript has similar thing too.
Tweet media one
5
1
77
@the_moisrex
The Moisrex
5 months
Which C++ Language Lawyer should I sue for this?
Tweet media one
10
2
76
@the_moisrex
The Moisrex
1 year
@alirezashirazi مشکل خونه‌های خالی رو با مالیات گرفتن میشه حل کرد، ولی متاسفانه ریشه مشکلات مسکن اینجاها نیست. این جماعت فقط بلدن سامانه بزنن و بعدشم هیچ! هک کردن سامانه کوچک‌ترین خلاف‌هایی هست که تو حوزه مسکن داره انجام میشه.
0
0
74
@the_moisrex
The Moisrex
7 months
Writing like this doesn't make you cool, it makes me wonder about your mental health.
Tweet media one
10
3
74
@the_moisrex
The Moisrex
2 months
I don't think beginner courses should be teaching c-style-casting anymore.
Tweet media one
14
2
71
@the_moisrex
The Moisrex
5 months
@biomance Not since about 2015. New processors are more or less have more cores, but their cores are not getting any much faster these days.
6
0
65
@the_moisrex
The Moisrex
4 years
@filipe_mulonde You can buy for free with the "objdump" command.
0
0
67
@the_moisrex
The Moisrex
1 year
@rasputin52 دکتری که بعد از ای�� همه کتاب خوندن نتونه جواب شبهات مریض رو بده به درد خودش می‌خوره خوندنش. من برنامه‌نویس همین الانش حداقل ۲ برابر این مطلب خوندم ولی هنوز ۱۰ تا رفرنس دم دستمه و هنوز در حال یاد گیریم هر روز. بعد بعضی دکترا میان یه چوب می‌کنن تو حلقت، بهتم نمی‌گن چته آخر!
3
0
60
@the_moisrex
The Moisrex
4 months
For some reason this is valid C++. Don't forget to type "case" because you might debug it for a while!
Tweet media one
17
2
58
@the_moisrex
The Moisrex
4 months
@transmutrix It gave me hives when we did a class per file in Java, I don't know what it give me in JavaScript!
5
0
56
@the_moisrex
The Moisrex
4 months
@timglabisch Let's put them on different servers, in different continents.🤣🤣
5
1
56
@the_moisrex
The Moisrex
1 year
liburing for C++: I've forked liburing to: - Header Only - No Undefined Behaviours - Standard compliant (No compiler-specific features) - pedantic friendly - C and C++ compatibility without any extern "C" or extern "C++"es
4
5
55
@the_moisrex
The Moisrex
4 months
I easily lose respect of the "library" and the people involved in the project when I see "telemetry" code built into the library. My users are my responsibility, not yours, and you don't get to gather information on them. It's a bad trend.
Tweet media one
6
7
54
@the_moisrex
The Moisrex
1 year
C++23 allows aliases in init-statements of for loops. Paper:
Tweet media one
8
2
52
@the_moisrex
The Moisrex
6 months
@StevenRadomski You can make sure they can't fire you :)
2
0
54
@the_moisrex
The Moisrex
7 months
The only reason: "package manager". That means the Rust teams are not coding, they're reusing open source projects.
@spastorino
Santiago Pastorino
7 months
“Rust teams at Google are as productive as ones using Go, and more than twice as productive as teams using C++.” @larsberg_ #RustNationUK
Tweet media one
43
223
1K
12
2
47
@the_moisrex
The Moisrex
5 years
@SpeakerPelosi Killing and congratulating! We haven't forgot Nancy; we haven't forgot!
2
0
34
@the_moisrex
The Moisrex
4 years
@joelnet Syntax error. The code starts with } and that's just wrong 😁
5
0
45
@the_moisrex
The Moisrex
5 months
DuckDB is a very interesting project. Its C++11 implementation could use some modernizing and a bit less allocations, but the idea very interesting.
Tweet media one
2
3
48
@the_moisrex
The Moisrex
4 years
The hardest part of C++ is CMake! There, I said it!
10
0
45
@the_moisrex
The Moisrex
2 years
@MilaDnu درد بزرگتر از نوت برداشتن اینه که هیچکس اونجا صداش در نیومد یه تذکری بده بگه حرفت مفته، حتی یه لبخند هم کسی نزد که بفهمیم حداقل یه نفر اونجا فهمیده که این داره حرف مفت میزنه!
1
0
45
@the_moisrex
The Moisrex
4 months
C23 is more C++ than C++ is C++! I feel like the compiler should be able to figure these attributes out on its own!
Tweet media one
6
3
45
@the_moisrex
The Moisrex
1 year
STOP USING COMPILER-SPECIFIC FEATURES IN HEADER FILES OF LIBRARIES.
Tweet media one
6
3
42
@the_moisrex
The Moisrex
2 years
سقوط حدود ۵۵ درصدی ترافیک کلودفلر از ایران نسبت به ۲۴ ساعت گذشته نشون دهنده تلاش جدید ایران برای از دور خارج کردن فیلترشکن‌هایی هست که از سرویس‌های مختلف کلودفلر مثل workerها، CDNهاش، سرورهاش و ... استفاده میکردن، هست.
Tweet media one
Tweet media two
3
5
41
@the_moisrex
The Moisrex
2 years
@_n0p_ @campuscodi Most systems are not vulnerable unless the application is somehow allowing 1GB of a string to be sent to SQLite's printf C functions. Won't cause too much damage fortunately.
2
2
43
@the_moisrex
The Moisrex
4 years
C++40 would be like:
Tweet media one
4
4
42
@the_moisrex
The Moisrex
1 year
What kinda scenarios are out there for having a 4 GiB URL? ( form ada-url )
Tweet media one
4
2
41
@the_moisrex
The Moisrex
1 year
@Purple_Elf This is not how we do it in C++, this is: 😅🤣 (also, there are other features like providing the starting index and multiple function arguments that I haven't added)
Tweet media one
5
1
38
@the_moisrex
The Moisrex
1 year
I like bit manipulating!
Tweet media one
3
0
36
@the_moisrex
The Moisrex
8 months
C++ Iceberg
Tweet media one
3
10
36
@the_moisrex
The Moisrex
1 year
@scrumtuous If someone meets 100% of the requirements, they're probably over-qualified for the job.
3
1
33
@the_moisrex
The Moisrex
8 months
Don't use do { .... } while (true); Use for (;;) { ... } I won't have to scroll 200 lines of code just to figure out it's an infinite loop.
6
0
35
@the_moisrex
The Moisrex
5 months
@VoxelPrismatic Beauty; utter beauty.
0
0
31
@the_moisrex
The Moisrex
2 years
@MilaDnu حجم جوک‌هایی که میشه از توش درآورد خیلی بالاس، بالا لامصب یکی یکی بگو بتونیم بخندیم خو. سکته میکنیم از خنده اینطوری که! 😅😂🤣🤣🤣
1
0
34
@the_moisrex
The Moisrex
7 months
Be aware of using <ranges> in performance issues. This simple snippet, produces different assemblies for -Os, -Og, -O0, -O1, -O2, and -O3 flags. Ranges relies too much on the compiler's optimizer. Don't use ranges where you can't have a "wildcard" to play a role in performance.
Tweet media one
Tweet media two
Tweet media three
Tweet media four
2
2
32
@the_moisrex
The Moisrex
3 years
Enjoy coding, forget about the final result!
Tweet media one
4
5
30
@the_moisrex
The Moisrex
1 year
2x is not enough, I need more!
Tweet media one
5
1
31
@the_moisrex
The Moisrex
6 years
#100DaysOfCode Day 100/100: It's amazing how much you can learn in just 100 days. My first round is done. Let's begin another one. Who's with me?
4
5
28
@the_moisrex
The Moisrex
6 months
@JakeArkinstall All loops, Ifs, Switches, Whiles, and even Functions, are all glorified gotos. The surprising part is that "case" statements are just labels and not blocks; that's why it's recommended to wrap case body with a pair of {}.
3
0
30
@the_moisrex
The Moisrex
6 years
#100DaysOfCode Day 070/100: I just implemented setInterval from javascript inside c++. I was just learning boost::asio and end up doing this! Oh, I just remembered I have to make it multi threaded to actually be the same as the setInterval. I'm just gonna go do that very quickly!
Tweet media one
0
7
27
@the_moisrex
The Moisrex
5 months
@JakeArkinstall Let's show them our constevals and constexpred code and let's see aseembly beat that :)
1
0
27
@the_moisrex
The Moisrex
5 years
# create a gif with linux: cd $(mktemp -d) for i in {1..25}; do convert ~/Pictures/cover.jpg -resize 384x384 -fill black -colorize $((100*$i/25))% "$i.png"; cp $i.png $((25*2-$i+1)).png; done ffmpeg -i %d.png -r 30 -b 512 animated-cover-384x384.gif
0
6
27
@the_moisrex
The Moisrex
3 years
@computerfact New languages ARE the improvements of the existing ones.
3
0
27
@the_moisrex
The Moisrex
4 months
@benhayesnyc In that case, you can put all of them in one single file, and then you'd definitely know which file they're in :)
1
0
27
@the_moisrex
The Moisrex
5 months
@TheTrueNemo The above code was found in a code base containing the new Houdini APIs; that's all I'm gonna say.
1
0
26
@the_moisrex
The Moisrex
3 years
@vahidrezazadeh5 یه ساعته انجام میدم براش. ساختن توئیتر کار خاصی نداره (نمونه ساده‌اش البته). ارزش توئیتر به کدهاش نیست، به کاربراشه. بفرما، اینجا 150 تا توئیتر ریخته:
0
1
25
@the_moisrex
The Moisrex
5 months
@puke_a_tronic They pretty much treat programming as bash scripts.
0
0
26
@the_moisrex
The Moisrex
2 years
@Digiato کره شمالی مهاجر نمیپذیره؟
0
1
22
@the_moisrex
The Moisrex
4 months
Saw this, and now I know the project I was reading did not care much about performance!
Tweet media one
2
1
25
@the_moisrex
The Moisrex
2 years
@freeman_ir29 مدیر بودن به همون سرعت که اومد به همون سرعت هم میتونه بره. مدیر بودن هدف نیست، پولدار شدن هم هدف نیست. هر دو وسیله‌ان برای رسیدن به چیز بهتری. همه اهداف تموم شدنی‌ان، این اون مسیر هست که مهمه. مسیر مهم‌تر از هدفه. شاید برا اون برنامه‌نویس، مسیر با ارزش‌تر بوده.
3
0
24
@the_moisrex
The Moisrex
1 year
@Digiato زارع‌پور که میگه ما نبودیم، قوه قضاییه هم میگه ما نیستیم. من بودم دیگه؟
0
0
23
@the_moisrex
The Moisrex
2 years
Sean makes me wanna write my own C++ compiler ☺️😅 Who will live long enough for me to do that? 😁
@seanbax
Sean Baxter
2 years
@the_moisrex @dyaroshev Cool I fixed the defining-type-id grammar to parse this. A nice little feature.
Tweet media one
1
1
9
1
3
24
@the_moisrex
The Moisrex
4 months
Did you know clang had and interpreter? Why have I not informed of this? $ clang-repl --Xcc=-std=c++23
Tweet media one
1
3
24
@the_moisrex
The Moisrex
6 months
4hrs of coding in Was working on IDNA Mapping Table Generator script of the project.
2
1
23
@the_moisrex
The Moisrex
4 months
@mesetatron Yes, and let's call them SHTML:
Tweet media one
0
0
23
@the_moisrex
The Moisrex
1 year
That's not how you supposed to set the C++ standard people! It creates so much problem for the users of your library.
Tweet media one
5
1
22
@the_moisrex
The Moisrex
2 years
If your bash script created a directory called "~" by mistake, don't "rm -rf ~" it :)
2
2
23
@the_moisrex
The Moisrex
1 year
@MilaDnu یعنی خود قاضی هم میتونه بیاد لینک گروه/کانال رو برداره و تبلیغ کنه و بعد بگه خوب پیام‌ها خصوصی نیست دیگه. ای کاش پیش‌نیاز نوشتن قانون/ToS/... «داشتن عقل» میبود!
0
0
21
@the_moisrex
The Moisrex
2 years
@trailofbits
Trail of Bits
2 years
Although this bug may be difficult to reach in deployed applications, it's an example of a vuln that is made easier to exploit by “divergent representations” that result from applying compiler optimizations to undefined behavior.
1
8
28
0
1
21
@the_moisrex
The Moisrex
1 year
I want to randomly line up C++ committee members and see if they can distinguish between these on the top of their mind 😅🙃: - std::launder - std::start_lifetime_from(_array) - new (ptr) ...[size] - reinterpret_cast
5
1
22
@the_moisrex
The Moisrex
5 years
#100DaysOfCode Round 4 Day 82: I was learning Spanish by watching TV series with English and Spanish subtitles. I had to spend 2mins between each episode to merge srt files; so I instead spent 2 month #coding a command line tool to do the whole TV series in one go! Am I smart?😅
0
16
20
@the_moisrex
The Moisrex
2 years
@mohmahdavian هک شخص با هک اداره فرق میکنه. کدوم یکی از این ادارارات و سازمان‌ها و شرکت‌هایی که هک شدن تو ایران اومدن حتی معذرت‌خواهی بکنن؟ حتی یه اطلاعیه نمیدن که آره ما هک شدیم. هنوز صدای هیچ‌کس در نیومده تو مملکت بعد از هک internet[dot]ir
0
0
19
@the_moisrex
The Moisrex
11 months
@tsoding No, you should use a proper templated C++ set of allocator-aware, generailzed, constexpr-friendly structs with RAII and what not.
0
0
21
@the_moisrex
The Moisrex
2 years
@vahidrezazadeh5 چوب اتحادیه اروپاست که تو پاچه ما داره میره. به جا این مسخره بازیا، به مرورگرها میگفتن یه چهار تا گزینه برای فعال کردن یا غیر فعال کردن این تکنولوژی‌ها بذارن کاربردی تر بود. جالب اینجاست الان حداقل ۳، ۴ تا جایگزین بهتر و راحت‌تر داره که فکر نمی‌کنم جزو GDPR باشن!
1
0
21
@the_moisrex
The Moisrex
8 months
Don't use real email address. Use a github anonymous email address, or other alternatives.
Tweet media one
0
2
19
@the_moisrex
The Moisrex
6 months
Lack of parenthesis is what wasted 4hrs of my life. auto length = cur & mapped_mask >> 24U; vs auto length = (cur & mapped_mask) >> 24U; Operator precedence has got me real good this time.
Tweet media one
@the_moisrex
The Moisrex
6 months
I'm at a point, where I'm debugging my tests, by correctly implementing a linear search, so I later can fix my binary-search-like algorithm with those tests. 😐 The tests are now more complicated than the algorithm! 🙃
Tweet media one
0
0
9
1
1
21
@the_moisrex
The Moisrex
1 year
Lower level languages teach you a certain mental model of how computers work that it is really hard for a programmer who only has skills in higher level langs to grasp. I got to C++ from a range of higher programming languages, so I can clearly pinpoint that exact milestone.
1
1
20
@the_moisrex
The Moisrex
5 months
Our C++ hello worlds are now contain unicode code point tables. I think unicode should be opt-in.
Tweet media one
Tweet media two
5
0
19
@the_moisrex
The Moisrex
1 year
@AliKahaei پس یارو اومده مصاحبه اونجا چیکار؟ اومده ببینه شما ارزشش رو دارین یا نه دیگه! پس فک کردی مصاحبه فقط برای اینکه که کارفرما بفهمه کارمند به درد میخوره و اصلا کارمند حق نداره کارفرما رو محک بزنه؟ اکثر شرکت‌ها هم که سایتشون وضعیتش مشخصه حقیقتا!
1
0
17
@the_moisrex
The Moisrex
4 years
I'm so proud of C++20 for letting me to be creative like this:
Tweet media one
4
1
18
@the_moisrex
The Moisrex
1 year
Wooo, exotic 🌶️
Tweet media one
C++ 20 Modules finally landed in CMake!!!!
0
4
34
0
2
19
@the_moisrex
The Moisrex
6 months
@kelleyllc Make sure to forward your codes to me when I'm unemployed. :)
2
0
20
@the_moisrex
The Moisrex
4 years
GCC says sorry; so cute :)
Tweet media one
2
1
18
@the_moisrex
The Moisrex
6 years
#100daysofCode Day 032/100: Oh man, I did not understand today's practice. I just jumped from beginner stuff to advanced stuff. Why I can't find a good tutorial on c++ that teaches the non-advanced and non-beginner stuff? #cpp #cpplus #cplusplus #coding #CodeNewbie
1
1
16
@the_moisrex
The Moisrex
9 months
You can't skip C++ and go directly to Rust :) "Kernel Rust" will essentially be C++ 😅🤌
@phoronix
Phoronix
9 months
A 2024 Discussion Whether To Convert The Linux Kernel From C To Modern C++ Well this is unexpected...
29
70
327
2
0
20
@the_moisrex
The Moisrex
5 years
#100DaysOfCode R3D94,95: I really like TDD. It helps you write loads and loads of un-compilable code and then be sure that you'll eventually debug it after a couple of years 😁. No biggie!
1
3
18
@the_moisrex
The Moisrex
2 years
This is how I route everything that I want to my v2ray proxy (which I only enable when my actual VPN connections are failing). This is called "Transparent Proxying" among other names like "Traffic Steering", "Traffic Hijacking", and "Intercepting Traffic" just to name a few.
Tweet media one
Tweet media two
Tweet media three
2
0
19
@the_moisrex
The Moisrex
1 year
@Rfnmt درباره تسنیم نمیتونم نظر بدم، ولی خیلی از مصاحبه‌کننده‌ها سوالای عجیب غریب اینجوری زیاد میپرسن، هدفشونم این نیست که فقط در صورتی که جواب بدی حرف رهبری رو قبول میکنم، قبولت کنن. هدف آشنایی با طرز فکر و نحوه برخورد با سوال و نحوه برخورد با سوالای عجیب غریب و تحمل و ... هست.
2
0
18
@the_moisrex
The Moisrex
1 year
@Digiato احیانا تلگرام شامل این اصل قانون اساسی نمیشه؟
2
0
17
@the_moisrex
The Moisrex
4 years
1. Extract the audio with ffmpeg; 2. Extract each frame into jpg with ffmpeg; 3. Convert JPGs into ASCII with jp2a; 4. Play the audio with aplay; 5. Print the ASCIIs in a loop; This is how you play a video in #Linux .
1
2
19