voidp


Channel's geo and language: Uzbekistan, Uzbek


Back End Developer at @uicgroup
TTPU 4/4
Do not follow trends blindly. Ask why you need it first.

Related channels

Channel's geo and language
Uzbekistan, Uzbek
Statistics
Posts filter


#c
How to read Stack Trace / Valgrind Report to find memory leaks?
Quyida example valgrind report berilgan:
https://pastebin.com/EvMEDjrS

Xo'sh, uni o'qib nimani tushunish mumkin? Here is my example:
0x483EB26 joylashuvida background memory allocation amalga oshmoqda. Bunga strdup() funksiyasini response.c faylimizning 17-qatorida httpresponse_constructor() ichida chaqirish sabab bo'lyapti. httpresponse_constructor() esa server.c faylning 212-qatorida request_handler() tomonidan, u esa server.c faylining 56-qatorida launch() tomonidan, u esa main.c faylining 31-qatorida main() funksiyasi yordamida chaqirilmoqda.


Okay, demak men shu yerda qilgan orqa fondagi mallocimni free qilmay ketibman:
HTTPResponse *httpresponse_constructor()
{
HTTPResponse *res = malloc(sizeof(HTTPResponse));
if (!res) return NULL;

res->status_code = 200;
res->version = strdup("HTTP/1.1");
res->reason_phrase = strdup("OK");
res->headers = NULL;
res->header_count = 0;
res->body = NULL;
res->body_length = 0;

return res;
}

🤔 Buni endi qanday free qilamiz?
Ownership kimdan kimga o'tyapti:
- httpresponse_constructor() dan request_handler() ga;
- request_handler() dan launch() ga.
Demak, launch() funksiyasi uni free() qilishga javobgar, demak free() shu yerda amalga oshiramiz.

@voidplog


#c
C da Pointer Ownership va Ownership Transfer
HTTP server misolida shu narsadan foydalanib ko'rdim:
🔗 https://gist.github.com/Samandar-Komilov/96a57b232cc95c3c7b35c5fdd566ab9d

Faqat, haliyam C da istaganni qilish mumkin. Owned pointerni free qilsam ham qilmasam ham compilerga 2 tiyin. Lekin baribir bu meni o'ylantirib qo'ydi: C++ dagi move semantikalari, Rustdagi ownership move shuni enhanced versiyasi ekanda demak... Bilmadim, yana research qilish kerak.

Feedbacklar, fikrlar 👇


@voidplog


#c #rs
💥 Memory Ownership Models mavzusiga qiziqib qoldim. Bir necha maqolalar topdim, yana bilsangiz share qiling pls :)

1⃣ Verdagon Dev - Single Ownership and Memory Safety without Borrow Checking.
2⃣ Carnegie Mellon University - Using Pointer Ownership Model to Secure Memory Management in C/C++.
3⃣ IEEExplore - Pointer Ownership Model

Ownership desa xayolga faqat Rust kelmaydi endi, Rust ham aslida general conceptni implement qilganini tushundik)


@voidplog


Forward from: kei
Glue Engineerlikdan tezroq o'sib chiqib ketish kerak, hali chiqib ketmagan bo'lsangiz


#c
🧪 Check - Unit Testing Framework for C
Surprisingly, there are many options available when it comes to testing in C.

https://libcheck.github.io/check/doc/check_html/check_3.html

@voidplog


#p
Ajoyib sarguzasht. Ultrabook jamoasiga rahmat. Ilojini topib MediaTek adapterni Intelnikiga almashtirib berishdi tekinga 🙌

Xo'sh jonajon fedora, mana yana uchrashdik:)


@voidplog


#p
❗ Yangi komp olmoqchi bo'lsangiz ichidagi adapter supportiga qarab oling. Linux uchun driver chiqmagan bo'lishi mumkin.

MediaTek MT7902 wifi & bluetooth adapter masalan. Hech qanaqasiga topilmadi, chunki bu yangi model ekanki hali Linux Kernelga qo'shilmagan emish. MediaTek bu borada tushuntirish ham bermabdi.

Iloji bo'lsa MediaTekdan uzoqroq turgan ma'qul menimcha. Let's see what happens next, yet another adventure for me:))
@voidplog


#c
💪🏿 The Power of GDB with Core files
You'll stop debugging with a bunch of printfs to see what's going on:)

🔗 Link

Main points:
- A core file contains the full state of the program when the program crashed;
- By default, you may not get core files when you compile your program. You should do a few commands;
- ulimit -c unlimited - means the kernel is allowed to produce unlimited amount of core files.
- By default, systemd manages coredump files, and it is not recommended to change the setting.
- Instead, we have coredumpctl command to see latest core dumps, manually writing to disk using coredump dump -o and use with gdb:
$ gdb

@voidplog


#university
🎓 Today, I understood that I don't hate university.

I respect the ilm. I respect subjects. I respect professors. But I hate numbers that define us which actually should not.

I'm against any kind of numbering, like GPA. No number should define us, we can do more than any number. Because you got 2.7, does not mean you are loser, weak and stupid. It means the education system is stupid which simply numbers you according to their trash exam principles.

@voidplog


#university
🎓 GPA qachon o'z ahamiyatini yo'qotadi? - mashhur Forbes nashrining maqolasi.

Qisqa xulosalar:
• 2018-2022 yillar oralig'ida ish beruvchilar GPA-based qaror qilishi 73% dan 37% ga tushib ketdi;
• Faqatgina 26% bitiruvchilar o'qigan bilimlari ishga aloqador ekanini tasdiqlaydi;
• GPA inflyatsiyasi ish beruvchilarda hamma A olgan studentlarni ajratib olishni qiyinlashtirdi: hamma A bo'lsa kimni olay?;
• O'rtacha GPA ko'tarilishi o'z navbatida ishga tayyor bo'lmagan bitiruvchilar sonini oshirmoqda;
• Natijada ish beruvchilar skill-based hiring jarayoniga o'tishmoqda. I don't care what your number is, show what you can do.


Xullas, GPA past bo'lib qoldi, endi nima qilaman deb o'ylab siqilish kerak emas. GPA past bo'ldi chunki rostdan o'qimadingiz. Or you questioned why I need these and found out most of them are irrelevant but time consuming. But you still have a chance: what can you do?

@voidplog


Nimaga Clean Architectures bekor o'rganmabman deb tupikka tiqilgandan keyin o'ylar ekanmiz-a? 😁

Hali shuncha ko'p narsa o'rganish kerakki...




#p
👨‍🏫 Dars o'tish jarayonida eng katta xatolardan biri - AI hamma joyni egallayapti, biz ham foydalansak nima deb GPTdan kodni olib copy-paste qilish.

Siz ustozmisiz? Kodni o'ziz yozing. Nimadir esdan chiqsa tan oling, google va stackoverflow qiling. Doc o'qing, errorlarni to'g'rilang. O'quvchilarni ham AIsiz error sababini topishlariga undang. Zato o'quvchilar jarayonni, uchraladigan muammolarni realtime kuzatish va o'rganish imkoniga ega bo'ladi.

Agar siz faqat nazariyani, kod qanday yozilishini quruq gapirib o'rgatsangiz, buni AI ancha yaxshi bajaradi. Quruq gapirganingizdan foyda yo'q. Lekin jarayonchi?

⚠️ Bu umuman GPT ishlatmang degani emas. Muammoni tez hal qilish kerak bo'lsa GPT okay. Lekin mavzu tushuntirganda kodni yozdirish o'quvchilarda ham shunday ko'nikma hosil qiladi.


@voidplog






trash.floss.uz - O'zbek Open Source community cook qilayotgan cho'tkiy proyekt.

Shaxsan men ham FP haqidagi postim ortidan tanqidga uchradim va bundan foyda oldim. Xuddi shu narsa butun linkedin bo'ylab yuz bersa va odamlar tanqidni to'g'ri qabul qilsa, nasib qilsa bu loyiha ilmimiz yanada ko'tarilishiga xizmat qiladi.

Post ideasi @zawkins dan "chopildi", rozi boʻlasiz bro :))

@voidplog




📈 Hozirgina 70 ta query va 1.5 sekund ketib turgan APIni 5 ta query va 0.03 s ga optimizatsiya qildik.

Odam mazza qivoratta shunaqa payt. Univerda asabni buzgan Applied mavzusiyam esdan chiqib ketadi😁

@voidplog


Miyangiz qanchalik AI'ga bog'lanib qolganini bilmoqchi bo'lsangiz bir necha kun AI ga parhez qilib ko'ring.

No ChatGPT.
No Grok.
No Claude.
Only you and your brain.
Only docs and stackoverflow.

You'll see how AI is ruining your brain...


@voidplog


#ca
📃 ARM Assembly Cheatsheet
Source: Azeria Labs

BTW, Azeria Labs website contains asm tutorial comprising 7 Parts, which is exactly matching with our university CompArch course.

@voidplog

20 last posts shown.