Nowadays, I am trying to learn different design patterns in object oriented paradigm that are pretty useful to implement generic solutions for different scenarios. Few weeks ago for a job hunt, I got an assignment to do which was a web application that would interact with database, so I took it up as a challenge and decided to make it loosely coupled using design patterns which were applicable in that scenario.
NET 5.0 Preview 8. منتشر شد
Today, we are releasing .NET 5.0 Preview 8. The .NET 5.0 release is now “feature complete”, meaning that very nearly all features are in their final form (with the exception of bug fixes still to come). Preview 8 is, appropriately, the last preview. We plan on releasing two go-live release candidates before the final .NET 5.0 release in November. This post describes a selection of features across the .NET 5.0 release.
کتاب رایگان NancyFX Succinctly
In NancyFX Succinctly, you'll learn what NancyFX is all about, where it came from, and what it can do for you as a .NET developer. Author Peter Shaw will explain why NancyFX is more than just another web framework, and teach you some of the many tricks that make it as easy as possible for you to create stunning web-enabled applications on the .NET platform.
معرفی کنترل چارت زیبای NVD3
- گروه بندی سطری و ستونی در چارت
- چارتهای خطی انباشته (cumulative)
- Pie Chart
- تولتیپ بر روی نودهای سریها
- چارتهای پشته ای (Stacked Area)
- چارتهای Discrete Bar
- چارتهای حبابی
- چارتهای گلوله ای (Bullet Chart)
This project is an attempt to build re-usable charts and chart components for d3.js without taking away the power that d3.js gives you. This is a very young collection of components, with the goal of keeping these components very customizeable, staying away from your standard cookie cutter solutions.
بررسی status code دریافتی از سرور
pm.test("Status code is 200", function () { pm.response.to.have.status(200); }); pm.test("Status code is 200", function () { pm.expect(pm.response.code).to.equal(200); }); pm.test("Request is successful", function () { pm.response.to.be.succes; }); // Status code is in the 2XX range pm.test("Request results in a client error", function () { pm.response.to.be.clientError; }); // Status code is in the 4XX range pm.test("Request results in a Not Found error", function () { pm.response.to.be.notFound; }); // 404 pm.test("Status code is 200 or 204", function () { pm.expect([200, 204]).to.include(pm.response.code); });
بررسی هدرهای دریافتی از سرور
pm.test("Response has Content-Type header", function () { pm.response.to.have.header("Content-Type"); }); pm.test("Response has Content-Type header with application/json; charset = utf - 8 as value", function () { pm.response.to.have.header( 'Content-Type', 'application/json; charset=utf-8'); });
بررسی بدنهی درخواست
pm.test("Response has a non-empty body", function () { pm.expect(pm.response.text()).not.empty; }); pm.test("Response has a non-empty body", function () { pm.expect(pm.response.json()).not.empty; }); pm.test("Response has a non-empty body", function () { pm.response.to.have.body(); }); pm.test("Response has a non-empty body", function () { pm.response.to.have.jsonBody(); });
بررسی خواص اشیاء دریافتی از سرور
var updatedAuthor = pm.response.json(); pm.test("Author properties have been updated", function () { pm.expect(updatedAuthor.firstName).to.equal("Vahid"); pm.expect(updatedAuthor.lastName).to.equal("N"); });
یک مثال ساده
using System; namespace AccessViolationExceptionSample { class Program { private static unsafe void AccessViolation() { byte b = *(byte*)(8762765876); } static void Main(string[] args) { try { AccessViolation(); } catch (Exception ex) { Console.WriteLine(ex); } Console.WriteLine("Press a key..."); Console.ReadKey(); } } }
System.AccessViolationException. Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
چرا قسمت catch اجرا نشد؟
از دات نت 4 به بعد، زمانیکه دسترسی غیرمجازی به حافظه صورت گیرد، برای مثال دسترسی به یک pointer آزاد شده، استثنای حاصل، توسط برنامه catch نشده و اجازه داده میشود تا برنامه کلا کرش کند. به این نوع استثناءها Corrupted State Exceptions یا CSE گفته میشود. اگر نیاز به مدیریت آنها توسط برنامه باشد، باید به یکی از دو طریق زیر عمل کرد:
الف) از ویژگی HandleProcessCorruptedStateExceptions بر روی متد فراخوان کتابخانهی native باید استفاده شود. برای مثال در کدهای فوق خواهیم داشت:
[HandleProcessCorruptedStateExceptions] static void Main(string[] args) {
<?xml version="1.0" encoding="utf-8" ?> <configuration> <runtime> <legacyCorruptedStateExceptionsPolicy enabled="true" /> </runtime> </configuration>
حسابداری برای توسعه دهندهها
Accounting For Software Engineers
The difference between accountants and software engineers, when it comes to accounting systems, is about what we primarily care about. Accountants care about meaning: is the quick ratio in good shape? Is income growing at an expected rate? How do we deal with an upcoming expense? Software engineers care about: will we properly move money around so that the balances are correct given certain latency, concurrency, etc.? Do we have the information required to generate the Income Statement? How do we represent a credit memo?