TorhamDev | تورهام 😳
Відкрити в Telegram
2 869
Підписники
Немає даних24 години
+107 днів
+6330 день
Архів дописів
2 869
برای اونایی که نمیدونن.
خیلی ها SQL فقط زبانی میدونن که باهاش رو اطلاعات دیتابیس CRUD انجام بدند. اما SQL یک عالمه فیچر متفاوت داره که واقعا به نظرم تبدیلش میکنه به زبان کامل برای نوشتن یک برنامه 😂.
۱. فانکشن داره
۲. چیزی به اسم پریسیژر داره که شبیه فانکشن با کمی تفاوت
۳. متغیر
۵. اعمال ریاضی انجام میده
۶. به دیتابیس هم که وصل هست 😂
تازه فیچر خوبش اینه که اگه از سیمیکالن(;) آخر هر دستور خوشتنون نمیاد میتونید تغییرش بدید به هرچی که دوست دارید🤝
2 869
Repost from Oh My Task!
An article that worth reading. It’s about comparing Python, Java and Go performance in multi-threaded computations.
The article shows the benchmarks of running Matrix multiplication, QuickSort and Conway’s game of life algorithms. These are the algorithms that take more than O(n) time complexity to run. Multithreading could do a lot for speedup the running process of them.
- Read Article
@OhMyTask
2 869
محتواهایی که برای آموزش میبینی/میخوانی/میشنوی(میچشی؟🗿) فارسی با انگلیسی؟
2 869
Talent is cheaper than table salt. What separates the talented individual from the successful one is a lot of hard work.- Stephen King
2 869
Repost from Oh My Task!
Gunicorn with Uvicorn inside
I'm up to reading the Gunicorn and Uvicorn source code and playing with the parameters to see the actual process/thread/coroutine management of those. I will write a detailed blog post about it soon but so far I wanna explain to you why it's recommended to use the Gunicorn web server with Uvicorn worker class.
The Gunicorn provides powerful worker management with lots of customizations. Gunicorn manages workers, and workers manage Python web applications. There are two types of workers which are sync and async. The term "async" here is a bit different than the async functions in Python. It's about the way worker serves the requests.
There are a couple of default worker classes in Gunicorn such as
sync, eventlet, gevent, torando and gthread. There are differences between request and web application handling in these workers that I will explore in the upcoming blog post. However, none of them can run the async functions in Python. So you will lose the power of this handy process manager for just being in async code style.
Here is the moment that Uvicorn comes. Although the Uvicorn is a standalone web server that runs ASGI applications in Python, but it does not have the abilities of Gunicorn. The great thing that developers of Uvicorn have done is that they developed a Uvicorn worker class based on the basic Gunicorn worker class. So you can easily run the Gunicorn to manage Uvicorn workers, and use this worker to serve incoming requests with async web applications.
To do that you can simply run this command:
gunicorn example:app -w 4 -k uvicorn.workers.UvicornWorker
This command will spawn 4 Uvicorn workers and loads the ASGI application into them. So you have the performance of Gunicorn and Uvicorn together.
You might ask if we should avoid running our apps only with Uvicorn? The answer is not the same for different situations. Sometimes you wanna keep the running process of a web application flat and simple to put it as a single processing unit into Kubernetes pods or Docker containers for better management and debugging. So you should see your structure first.
@OhMyTask2 869
بچهها بچهها با نمره ۱۲.۲۹ مشروط نشدم😂🤝 فقط با ۲۹ آخرش و در کل هم ۳ تا امتحان
BROOO😂
2 869
ماجرا این هم برمیگرده به دوتا فانشکن پایتون که ne و eq هستن که میتونید توضیح فانکشن eq تو این پست:
چطوری آبجکتی خلق کنیم که با همه چیز برابر باشه؟
و فانکشن en دقیقا برعکس eq عه. eq مخفف equal عه و زمانی ران میشه که از == در پایتون استفاده میکنیم و ne مخفف not equal که وقتی از != استفاده میکنیم اجرا میشه.
@TorhamDevCH
2 869
Repost from جادی | Jadi
آی بی ام این امکان رو برای عموم فراهم کرده که با سیستم
IBM i
کار کنن. اگر دوست دارین توی این سایت اکانت باز کنین و درک وسیعتری از سیستم عامل ها پیدا کنین؛ به هرحال کار کردن روی پاور سیستم و امکان نوشتن سی و فرترن روش جالبه (:
https://pub400.com/
2 869
از NF هم بخام یک موزیک بردارم.
خط به خط حق
I could be workin' for 24 hours a day and think I never did enough
#music
2 869
در پایتون شما هر iterator ای رو میتونید Unpack کنید. اما iterator چیه؟ و Unpacking یعنی چی؟
ساده بخام بگم هر آبجکتی که بشه رو حرکت کرد و دیتا گرفت iterator عه مثل لیست، دیکشنری، تاپل و ...
بهتر بخام بگم هر آبجکتی که متد
iter و اگه اشتباه نکنم next رو داره.
خب حالا unpacking کردن چیه؟ آنپک کردن یجورایی Map کردن محصوب میشه مثال زیر رو ببینید:
a, b, c = 1, 2, 3
خب از پست قبلی میدونیم که پایتون با ویرگول(،) میاد tuple میسازه پس سمت راست مساوی یک tuple حالا کارز که پایتون میکنه میاد این tuple رو آنپک میکنه و به متغییرها اون ور Map میکنه. دونه دونه و به ترتیب در نتیجه a میشه 1 و b میشه 2 و c۹ میشه 3
حالا که اینو میدونید بزاید نظر شمارو به چیز دیگه ای جلب کنم :)
مثال پایین رو ببینید:
def test(*args):
print(args)
test(1, 2, 3)
خروجی این کد چی میشه؟ اگه این کد اجرا کنیم خروجی مثل زیر باید بگیریم
(1, 2, 3)
که آرهههه یک tuple عه :)))))
نکته باحال و هیجان انگیز اینه که پایتون در اصل ورودی های فانشکن unpack میکنه و map میکنه به ورودی ها فانشکن :))) و یکی از دلایلی که نمیتونید بعد یک ورودی a=3 داخل فانشکن ورودی عادی بدون مقدار پاس بدید. چون دیگه نمیتونه unpack و map کنه :)
اگه چیز بیشتری در این باره میدونید تو کامنتها بگید🤝
این پست اگه 20 تا 🤯 بگیره پست بعدی میزارم😂(باج گیری)
@TorhamDevCH
Вже доступно! Дослідження Telegram за 2025 — головні інсайти року 
