مطالب
Dependency Injection

در ادامه مباحث بهتر کد بنویسیم و الگوهایی که در این رابطه معرفی شدند، اخیرا کتابی از انتشارات manning منتشر شده تحت عنوان Dependency Injection . هر چند به ظاهر این کتاب برای جاوا کارها تهیه شده اما قسمت عمده‌ای از آن برای سایر زبان‌های برنامه نویسی دیگر نیز قابل استفاده است.




DESCRIPTION
In object-oriented programming, a central program normally controls other objects in a module, library, or framework. With dependency injection, this pattern is inverted—a reference to a service is placed directly into the object which eases testing and modularity. Spring or Google Guice use dependency injection so you can focus on your core application and let the framework handle infrastructural concerns.
Dependency Injection explores the DI idiom in fine detail, with numerous practical examples that show you the payoffs. You'll apply key techniques in Spring and Guice and learn important pitfalls, corner-cases, and design patterns. Readers need a working knowledge of Java but no prior experience with DI is assumed.

WHAT'S INSIDE:
◊ How to apply it (Understand it first!)
◊ Design patterns and nuances
◊ Spring, Google Guice, PicoContainer, and more
◊ How to integrate DI with Java frameworks


راستی، این کتاب تر و تازه رو می‌تونید از همین کتاب فروشی‌های دور و اطراف نیز تهیه کنید! در سایت booktraining دات ارگ در قسمت graphics-and-design به تاریخ 4 آگوست.



اشتراک‌ها
چگونه با dotNET Core اپلیکیشن های چند پلتفرمه بسازیم

One of the main reasons for using .NET Core is that you can run it on multiple platforms and architectures. So you can build an app that will run on Windows, but also on Linux, macOS and on different architectures like x86 and ARM. This is perfect for lots of scenarios, including desktop applications. 

چگونه با dotNET Core اپلیکیشن های چند پلتفرمه بسازیم
اشتراک‌ها
پروژه‌ی Silver

Silver is a free implementation of Apple's Swift programming language.

With Silver, you can use Swift to write code directly against the .NET, Java, Android and Cocoa APIs. And you can also share a lot of non-UI code between platforms. 

پروژه‌ی Silver
اشتراک‌ها
سری 47 قسمتی ساخت یک برنامه‌ی واقعی با Angular 10 و ASP.Net Core Web API

Build Real App in Angular 10 and ASP.Net Web API

These are 2 of the hottest frameworks right now for the ‘back-end’ (Microsoft’s ASP.NET Core) and the ‘front-end’ (Google’s Angular) and are well worth spending the time to learn.
This course starts from scratch, you neither need to know Angular 1 nor Angular 2
We will start from nothing and incrementally build this property dealing application front-end using Angular 10.
And then we will connect our front-end with the Web-API until we have a fully functional Web Application that we will publish to Firebase and then on IIS.

سری 47 قسمتی ساخت یک برنامه‌ی واقعی با  Angular 10 و ASP.Net Core Web API
اشتراک‌ها
ارجاعات در فایل XML

XML in general is a powerful beast, with so many options available that it quickly gets really complex. The XML Digital Signatures standard is no exception to that. The extra features complexity of XML DSig compared to other signature standard is that one or more different blocks of data can be signed by the same signature block. That data can be the containing XML Document, part of an XML document or some other resource such as a web page. In this post we’ll only look at signing resources in the document containing the signature. 

ارجاعات در فایل XML
اشتراک‌ها
مقایسه کارآیی خروجی زبان‌های مختلف برنامه نویسی

Microbenchmark testing Python, Numba, Mojo, Dart, C/gcc, Rust, Go, JavaScript, C#, Java, Kotlin, Pascal, Ruby, Haskell performance in Mandelbrot set generation 

Benchmarking several languages/tools with Mandelbrot set generation. 1-to-1 translation of code from one language to another. No SIMD, no multithreading (except prange() trick with Numba), no tricks (e.g. skipping sqrt), a bare minimum of language specific adjustments to make the code nicer while keeping all loops and operations in place. 

مقایسه کارآیی خروجی زبان‌های مختلف برنامه نویسی
نظرات مطالب
فعال سازی قسمت ارسال فایل و تصویر ویرایشگر آنلاین RedActor در ASP.NET MVC
با تشکر فراوان از لطفتون. همچنین یک راهنمای جالب برای این سایت اینجاست. دوستانی که میخوان کمی تغییرات در این ادیتور بدن مثلا زبان فارسی اضافه کنن یا یک سری امکانات این چنینی حتما آدرس زیر رو ببین. چیز‌های جالبی داخلش هست.
http://imperavi.com/redactor/docs/ 
همچنین داخل این راهنما خروجی هم دقیقا آئرده شده که من بعد از سوال پیدا کردم. خروجی برای image باید به شکل زیر باشه
{ "filelink": "/images/img.jpg" }
و برای فایل هم به شکل زیر باشه
{ "filelink": "/files/file.doc", "filename": "Filename" }
چیزی که خیلی وقت من رو گرفت اون اسلش قبل نام فایل بود که نمیزاشتم و خروجی مد نظر رو بم نمیداد. دوستان این قضیه رو حتما مد نظر داشته باشن تا مثل من وقتشون زیاد گرفته نشه :)
مطالب
روش نصب NET SDK. بر روی لینوکس Ubuntu

اگر از آخرین نگارش Ubuntu استفاده می‌کنید، با توجه به همکاری مایکروسافت و شرکت پشتیبان آن، نصب دات‌نت به سادگی اجرای دستور زیر است:

$ sudo apt update && sudo apt install -y dotnet-sdk-8.0
$ dotnet --version

و اگر می‌خواهید بدانید که چه ‌نگارشی از دات‌نت، به‌همراه مخازن استاندارد Ubuntu است، دستور زیر را صادر کنید:

$ apt search dotnet-sdk*

که یک نمونه خروجی آن به صورت زیر است:

$ apt search dotnet-sdk*
Sorting... Done
Full Text Search... Done
dotnet-sdk-8.0/noble-updates,noble-security 8.0.107-0ubuntu1~24.04.1 amd64
  .NET 8.0 Software Development Kit

dotnet-sdk-8.0-source-built-artifacts/noble-updates,noble-security 8.0.107-0ubuntu1~24.04.1 amd64
  Internal package for building the .NET 8.0 Software Development Kit

dotnet-sdk-dbg-8.0/noble-updates,noble-security 8.0.107-0ubuntu1~24.04.1 amd64
  .NET SDK debug symbols.

نصب اسکریپتی آخرین نگارش دات‌نت بر روی تمام توزیع‌های لینوکسی

مایکروسافت، اسکریپتی را برای دریافت و نصب خودکار آخرین نگارش دات‌نت، تهیه کرده‌است که کار با آن بسیار ساده‌است و با تمام توزیع‌های لینوکسی و نه فقط Ubuntu سازگار است.

پیش از هرکاری ابتدا مخزن‌های بسته‌ها و برنامه‌های مرتبط را یکبار به‌روز کرده و سیستم را ری‌استارت می‌کنیم:

sudo apt update -q && sudo apt upgrade -y && reboot

سپس دستور زیر را صادر می‌کنیم تا اسکریپت نصاب مخصوص دات‌نت خود مایکروسافت را دریافت کنیم :

wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh
chmod +x ./dotnet-install.sh

توسط این دو دستور، فایل dotnet-install.sh دریافت شده و همچنین دسترسی اجرایی بودن آن نیز تنظیم می‌شود.

پس از آن، برای نصب آخرین نگارش دات‌نت SDK موجود، تنها کافی است دستور زیر را صادر کنیم:

./dotnet-install.sh --version latest

و یا اگر فقط می‌خواهید runtime آن‌را نصب کنید، پارامترهای نصب، به صورت زیر تغییر می‌کنند:

./dotnet-install.sh --version latest --runtime aspnetcore

همچنین اگر نگارش‌های پایین‌تر مدنظر شما هستند، می‌توانید کانال نصب را هم مشخص کنید:

./dotnet-install.sh --channel 7.0

که یک نمونه خروجی اجرای دستور dotnet-install.sh --version latest/. آن به صورت زیر است:

$ ./dotnet-install.sh --version latest
dotnet-install: Attempting to download using aka.ms link https://dotnetcli.azureedge.net/dotnet/Sdk/8.0.303/dotnet-sdk-8.0.303-linux-x64.tar.gz
dotnet-install: Remote file https://dotnetcli.azureedge.net/dotnet/Sdk/8.0.303/dotnet-sdk-8.0.303-linux-x64.tar.gz size is 223236164 bytes.
dotnet-install: Extracting archive from https://dotnetcli.azureedge.net/dotnet/Sdk/8.0.303/dotnet-sdk-8.0.303-linux-x64.tar.gz
dotnet-install: Downloaded file size is 223236164 bytes.
dotnet-install: The remote and local file sizes are equal.
dotnet-install: Installed version is 8.0.303
dotnet-install: Adding to current process PATH: `/home/vahid/.dotnet`. Note: This change will be visible only when sourcing script.
dotnet-install: Note that the script does not resolve dependencies during installation.
dotnet-install: To check the list of dependencies, go to https://learn.microsoft.com/dotnet/core/install, select your operating system and check the "Dependencies" section.
dotnet-install: Installation finished successfully.

همانطور که مشاهده می‌کنید، دات‌نت 8.0.303، نصب شده‌است.

پس از پایان نصب، دو دستور زیر را هم باید اجرا کنید تا بتوان در خط فرمان به NET CLI. دسترسی یافت:

$ export DOTNET_ROOT=$HOME/.dotnet
$ export PATH=$PATH:$DOTNET_ROOT:$DOTNET_ROOT/tools

پس از این تنظیمات، امکان اجرای دو دستور آزمایشی زیر میسر می‌شوند:

$ dotnet --version
$ dotnet --list-sdks

نصب دات‌نت بر روی نگارش‌های قدیمی‌تر Ubuntu

برای اینکه بتوان به روش متداولی (بدون دریافت اسکریپت نصاب فوق) به آخرین تغییرات انجام شده و آخرین به‌روز رسانی‌ها و همچنین تمام نگارش‌های دات‌نت دسترسی داشت، می‌توان از مخازن بسته‌های خود مایکروسافت استفاده کنیم که باید آن‌ها را به سیستم عامل اضافه کرد. برای اینکار باید مراحل زیر طی شوند:

ابتدا تمام وابستگی‌های احتمالی موجود را حذف می‌کنیم:

$ sudo apt remove 'dotnet*' 'aspnet*' 'netstandard*'

سپس فایل زیر را ایجاد کرده:

sudo nano touch /etc/apt/preferences

و آن‌را با محتوای زیر تکمیل می‌کنیم؛ تا فقط از مخازن خود مایکروسافت استفاده شود و سایر مخازن مرتبط در این حالت، اولویت کمتری داشته باشند:

Package: dotnet* aspnet* netstandard*
Pin: origin "archive.ubuntu.com"
Pin-Priority: -10

Package: dotnet* aspnet* netstandard*
Pin: origin "security.ubuntu.com"
Pin-Priority: -10

پس از آن، دستورات زیر، کار افزودن مخازن بسته‌های مایکروسافت را انجام می‌دهند:

# Get OS version info which adds the $ID and $VERSION_ID variables
source /etc/os-release

# Download Microsoft signing key and repository
wget https://packages.microsoft.com/config/$ID/$VERSION_ID/packages-microsoft-prod.deb -O packages-microsoft-prod.deb

# Install Microsoft signing key and repository
sudo dpkg -i packages-microsoft-prod.deb

# Clean up
rm packages-microsoft-prod.deb

# Update packages
sudo apt update
sudo apt upgrade -y

بعد از این به‌روز رسانی‌ها، دستور متداول زیر، کار نصب آخرین نگارش NET SDK. را انجام می‌دهد:

sudo apt-get install -y dotnet-sdk-8.0

و همچنین هربار هم که سیستم را با دستورات sudo apt update -q && sudo apt upgrade -y به روز کنیم، در صورت وجود به‌روز رسانی دات‌نتی جدیدی، آن‌را به صورت خودکار دریافت و نصب می‌کند.