Web_programming
1.14K subscribers
354 photos
14 videos
125 files
1.22K links
Sharif web programming
If you have any questions, please feel free to ask(@yumcoder)
Download Telegram
In Go, static (compile-time) binding in generic functions refers to the ability to determine the types and the operations that can be performed on those types during compile time.


package main

import "fmt"

// Define a type constraint interface
// that ensures the type supports basic arithmetic operations.
type Number interface {
int | int64 | float64
}

// Generic function that works with any type that satisfies the Number constraint.
func add[T Number](a, b T) T {
return a + b
}

func main() {
fmt.Println(add(3, 4)) // int
fmt.Println(add(3.5, 4.2)) // float64
fmt.Println(add(int64(3), int64(4))) // int64
}
👍3
درود
کسانی که می‌توانند یک sign up, sign in را به کمک nodejs به یک وب‌سایتم اضافه کنند. لطفا به من پیغام دهند.
😁5
Forwarded from Quera
🏆 شروع ثبت‌نام مسابقات #المپیکـفناوری

🏁 مسابقات برنامه‌نویسی:
- Algorithm
- PHP/Laravel
- Python/Django
- Front-end

🏁 مسابقات هوش مصنوعی:
- پردازش داده
- پردازش تصویر
- پردازش متن

🎁 در مجموع ۵۴۰ میلیون تومان جایزه نقدی به نفرات برتر مسابقات 

✔️ رقابت انتخابی: مسابقه آنلاین با هدف شناسایی تیم‌های برگزیده برای رقابت نهایی
✔️ رقابت نهایی: به صورت حضوری در پارک فناوری پردیس

اطلاعات بیشتر و ثبت‌نام تیمی در مسیر برنامه‌نویسی:
🔗 https://quera.org/r/3box9

اطلاعات بیشتر و ثبت‌نام تیمی در مسیر هوش مصنوعی:
🔗 https://quera.org/r/imz20


@Quera_ir @Olympics_tech

#Quera #Quera_contest
👍3🎉2
یکی از مشکلاتی که در زبان جاوا اسکریپت برای دوستانی که به تازگی آن را شروع کرده اند پیش میاد، عدم درک صحیح از مکانیزم آن در زمانی است که یک کار باید به صورت آسنکرون (غیر همگام) انجام شود. به صورت پیش فرض، زبان جاوا اسکریپت یک زبان Synchronous است و به صورت Blocking اجرا میشود؛ یعنی دستورات به صورت یک به یک اجرا میشوند و اجرای هر خط ، پیش از پایان نیافتن خط قبلی صورت نمیگیرد.
حالا شما تصور کنید که دستوراتی مثل fetch و یا set Time Out (که باعث وقفه در اجرای برنامه می شوند) بخواهند به صورت بلاکینگ اجرا شوند! با توجه به این که جاوا اسکریپت روی یک نخ (Thread) اجرا میشود، عملا اجرای برنامه تا پایان نیافتن این دستورات به وقفه می افتد (و حتی ممکن هست برنامه Crash کند) !
برای این منظور، در جاوا اسکریپت مکانیزمی به نام Event Loop پدید آمد که امکان برنامه نویسی آسنکرون را در جاوا اسکریپت فراهم کرده. این مکانیزم به جاوا اسکریپت اجازه میدهد که اجرای برنامه، معطل اجرای این دستورات زمانبر نماند و به نحوی، مکانیزم چند نخی را تا حدودی شبیه سازی میکند (اجرا نمیکند).
گاهی درک مکانیزم Event Loop مقداری مبهم هست. در مقاله ای که لینک آن را در ادامه میگذارم، این مکانیزم رو با یک مثال خیلی ساده و به صورت انیمیشنی و به صورت گام به گام نشان داده که احتمالا برای درک این موضوع میتواند مفید باشد.

https://dev.to/lydiahallie/javascript-visualized-event-loop-3dif
👍8
فردی برای یک task توسعه‌ نرم‌افزازی به دنبال یک نیرو است اگر تمایل داشتید پیغام دهید تا معرفی کنم

یک وب کرالر با جاوا اسکریپت (nodejs). این کرالر یک URL و یک عدد از ورودی دریافت کند و تمام لینک‌های مرتبط به‌همان وب‌سایت را کرال کند. عدد ورودی عمق کرال را تعیین میکند. خروجی هر وب‌سایت یک RSS است و هر web page کرال شده یک رکورد از RSS است.
استفاده از هر کتابخانه‌‌ی JS مجاز است.
👍1
In the Linux terminal, when you use Ctrl + R for reverse search (searching previous commands in history), you can go to the next match by pressing Ctrl + R again.
😁2
برای کسانی که میخواهند به تازگی ReactJS را یاد بگیرند ...

علت اساسی تولید هر کتاب خانه و یا هر فریم ورک، بر اساس یک نیاز بنیادین صورت میگیرد و اگر آن نیاز بنیادین (چالش هایی که داشته و راهکارهایی که به دنبال آن چالش ها توسط این فریم ورک ها ارائه شده) درک نشود، از آن ابزار صرفا به مثابه یک ابزار ساده استفاده میشود و محدودیت ها و قدرت آن به درستی درک نمیشود.
در خصوص کتابخانه ReactJS و کتابخانه های مرتبط دیگری که معمولا به منظور ساخت برنامه های تک صفحه ای (SPAs) مورد استفاده قرار میگرند، یکی از چالش های اساسی (که منجر به ارائه این ابزارها شده) ، تولید تمام HTML صرفا به صورت داینامیک است (احتمالا اگر با create-react-app اقدام به ساخت اپلیکیشن بکنید، خواهید دید که صرفا یک فایل HTML با یک div خالی دارید که قرار است همه چیز در آن اتفاق بیفته). هر تغییر کوچک در مدل DOM صفحه منجر به تغییراتی در زیردرختان عنصر تغییر یافته میشود و در نتیجه، بسیار پرهزینه است.
با استفاده از کتابخانه ReactJS و Virtual DOM میتوان این تغییرات را با کمترین هزینه انجام داد. برای آشنایی با این تکنولوژی، مطلب زیر را مطالعه کنید

https://www.geeksforgeeks.org/reactjs-virtual-dom/
👍4
In gRPC, the maximum size for a single message is determined by the protocol buffer's inherent limit, which is 2 GB. This means that, in theory, gRPC can handle messages up to 2 GB in size. However, it's important to note that many gRPC implementations set default limits that are much lower. For example, the default maximum message size is often set to 4 MB, though this can be configured to accommodate larger messages. Attempting to send messages larger than the configured limit will result in errors. Therefore, while the protocol allows for messages up to 2 GB, practical implementations may impose stricter limits to ensure performance and resource management.
👍5
In terms of message in the group of this channel, gpt propose that 👇

When you receive a message in a group that seems to be related to investment and might be a scam, it’s important to take these steps:

1. Do Not Engage: Avoid clicking on any links, responding to the message, or providing any personal information. Scammers often use engagement as a way to trap more victims.

2. Report the Message: Use the platform’s “Report” feature to flag the message or user. Most messaging apps allow you to report spam or suspicious activity, which helps the platform take necessary action.

3. Warn the Group: Politely notify the group about the suspicious message, as others may not recognize it as a potential scam. You could say something like, "This message might be a scam. Be cautious about sharing personal or financial information."

4. Block the Sender: If the sender is not someone you know or trust, consider blocking them to prevent further contact.

5. Alert the Group Admins: If you’re not the admin, reach out to the admin(s) privately and inform them of the message so they can take any necessary steps, such as removing the user or limiting new group members’ posting abilities.

6. Educate Yourself and Others: Remind yourself and group members of common scam tactics. Investment scams often promise high returns with little risk, urge quick decisions, or make you feel special or chosen.

7. Avoid Sharing the Message Outside the Group: Don’t forward or share the message to others, as this could help spread the scam further.

Following these steps helps protect yourself and others from falling victim to scams in group chats.
👍2👎1
Sound to Text → then Summarize 🙂
——————

pip install git+https://github.com/openai/whisper.git

import whisper

# Load Whisper model
model = whisper.load_model("base")

# Transcribe audio
result = model.transcribe(“/PATH/FILE.m4a")
print("Transcription:", result["text"])
🎉5
End-to-end (E2E) testing is a technique used to test the entire flow of an application, simulating real user interactions from start to finish. In E2E testing, the goal is to ensure that all parts of the application (frontend, backend, and data storage) work together as expected.

Some popular tools and frameworks for E2E testing include:
- Puppeteer
- Selenium
👍3
Forwarded from Niyusha Baghayi
وبینار نقشه‌راه مهندسی داده

🎯 مسیر یادگیری و ورود به بازار کار در مهندسی داده

📅 تاریخ: سه‌شنبه ۲۹ آبان ۱۴۰۳
🕖 ساعت: ۱۹:۰۰ به وقت ایران

🔗 لینک ورود به گروه Databurst Connect جهت شرکت در وبینار
📆 افزودن به تقویم
🔸 لینکدین نیوشا بقایی
🔹 لینکدین مصطفی قدیمی
👍2👎1
میکرومستر مهندسی نرم‌افزار
هدف
هدف از این میکرومستر آموزش و آماده‌سازی دانش‌پذیران برای ورود به بازار کار به عنوان مهندس نرم‌افزار است. محتوای میکرومستر با توجه به نیازهای مطرح شده توسط مهم‌ترین شرکت‌های کشور تهیه شده است.

مخاطبین
افرادی که علاقه‌مند به ارتقاء سطح کاری و دانش خود هستند.
دانش‌آموزان و دانشجویانی که علاقه‌مند به آمادگی برای ورود به بازار کار در آینده هستند.
افرادی که علاقه‌مند به ارتقاء سطح دانشی خود در حوزه مهندسی نرم‌افزار هستند.

https://micro.ce.sharif.edu/sw
👎7👍4😁3
👍2
docker system df -v
- check the disk usage of all Docker resources

docker volume prune
- This will remove all volumes not currently used by a container.