Using Random on the production may put you in a troubleβοΈ
What is a random numberβ
Well, even if you have never read any definition, you can still answer that question pretty easy. π€·π»ββοΈ
Itβs the unpredictable result of some action like throwing a dice. π²
We just canβt predict what the next number will be. β
In a real world, randomness is kind of natural thing, but it starts to be more complicated when it comes to machines. π»
WhyβSimply because of their deterministic characteristic which makes it really hard to generate random numbers (but itβs still possible). β
Thatβs why in most of the time we use the pseudorandom numbers β they look like a random but they are the result of some mathematical algorithms.β‘οΈ
Are they used in generator offered in C#β
Letβs find out. π€
https://t.me/pgimg/166
[ Article ] : kutt.it/rnd
γ°γ°γ°γ°γ°γ°
#CSharp #Random
@ProgrammingTip
What is a random numberβ
Well, even if you have never read any definition, you can still answer that question pretty easy. π€·π»ββοΈ
Itβs the unpredictable result of some action like throwing a dice. π²
We just canβt predict what the next number will be. β
In a real world, randomness is kind of natural thing, but it starts to be more complicated when it comes to machines. π»
WhyβSimply because of their deterministic characteristic which makes it really hard to generate random numbers (but itβs still possible). β
Thatβs why in most of the time we use the pseudorandom numbers β they look like a random but they are the result of some mathematical algorithms.β‘οΈ
Are they used in generator offered in C#β
Letβs find out. π€
https://t.me/pgimg/166
[ Article ] : kutt.it/rnd
γ°γ°γ°γ°γ°γ°
#CSharp #Random
@ProgrammingTip
Telegram
Programming Tips Resources
Span π
C# gives us great flexibility when it comes to using different kinds of memory. π
But the majority of the developers use only the managed one. π€·π»ββοΈ
Use Span to work with ANY kind of memory in a safe and very efficient way. Simplify your APIs and use the full power of unmanaged memoryβοΈ
https://t.me/pgimg/170
[ Article ] : adamsitnik.com/Span
γ°γ°γ°γ°γ°γ°
#CSharp #DotNet
@ProgrammingTip
C# gives us great flexibility when it comes to using different kinds of memory. π
But the majority of the developers use only the managed one. π€·π»ββοΈ
Use Span to work with ANY kind of memory in a safe and very efficient way. Simplify your APIs and use the full power of unmanaged memoryβοΈ
https://t.me/pgimg/170
[ Article ] : adamsitnik.com/Span
γ°γ°γ°γ°γ°γ°
#CSharp #DotNet
@ProgrammingTip
Telegram
Programming Tips Resources
Pose π₯
Replace any .NET method (including static and non-virtual) with a delegate. π
It is similar to Microsoft Fakes but unlike it Pose is implemented entirely in managed code (Reflection Emit API).β¨
Everything occurs at runtime and in-memory, no unmanaged Profiling APIs and no file system pollution with re-written assemblies.β‘οΈ
Example Usage π₯:
Shim static property getter β±:
[ Github ] : github.com/tonerdo/pose
γ°γ°γ°γ°γ°γ°
#CSharp #DotNet #Fake
@ProgrammingTip
Replace any .NET method (including static and non-virtual) with a delegate. π
It is similar to Microsoft Fakes but unlike it Pose is implemented entirely in managed code (Reflection Emit API).β¨
Everything occurs at runtime and in-memory, no unmanaged Profiling APIs and no file system pollution with re-written assemblies.β‘οΈ
Example Usage π₯:
Shim static property getter β±:
Shim dateTimeShim = Shim.Replace(() => DateTime.Now).With(() => new DateTime(2004, 4, 4));
Usage πΎ:// This block executes immediately
PoseContext.Isolate(() =>
{
// All code that executes within this block
// is isolated and shimmed methods are replaced
// Outputs "4/4/04 12:00:00 AM"
Console.WriteLine(DateTime.Now);
}, dateTimeShim);
https://t.me/pgimg/179[ Github ] : github.com/tonerdo/pose
γ°γ°γ°γ°γ°γ°
#CSharp #DotNet #Fake
@ProgrammingTip
Telegram
Programming Tips Resources
Reinforced.Typings β‘οΈ
Converts C# classes to TypeScript interfaces (and many more) within project build. π
Examples β¨ :
C# β₯οΈ :
[ Github ] : kutt.it/csts
γ°οΈγ°οΈγ°οΈγ°οΈγ°οΈγ°οΈ
#CSharp #TypeScript
@ProgrammingTip
Converts C# classes to TypeScript interfaces (and many more) within project build. π
Examples β¨ :
C# β₯οΈ :
[TsInterface]
public class Order
{
public string ItemName { get; set; }
public int Quantity { get; set; }
public double Subtotal { get; set; }
public bool IsPaid { get; set; }
public string ClientName { get; set; }
public string Address { get; set; }
}
[TsClass]
public class User
{
public string FirstName { get; set; }
public string Email { get; set; }
public UserType Type { get; set; }
}
[TsEnum]
public enum UserType { One, Two }
Result => TypeScript π :export interface IOrder
{
ItemName: string;
Quantity: number;
Subtotal: number;
IsPaid: boolean;
ClientName: string;
Address: string;
}
export class User
{
public FirstName: string;
public Email: string;
public Type: MyApp.UserType;
}
export enum UserType {
One = 0,
Two = 1,
}
https://t.me/pgimg/188[ Github ] : kutt.it/csts
γ°οΈγ°οΈγ°οΈγ°οΈγ°οΈγ°οΈ
#CSharp #TypeScript
@ProgrammingTip
Telegram
Programming Tips Resources
Mapster π₯
A fast, fun and stimulating object to object .NET Mapper. β‘οΈ
Don't let other libraries slow you down, raw Mapster performance is at least 2.5 times fasterβοΈ
https://t.me/pgimg/192
[ Github ] : kutt.it/mapster
[ Performance Benchmark ] : kutt.it/mapbnch
γ°οΈγ°οΈγ°οΈγ°οΈγ°οΈγ°οΈ
#Mapper #Mapster #CSharp
@ProgrammingTip
A fast, fun and stimulating object to object .NET Mapper. β‘οΈ
Don't let other libraries slow you down, raw Mapster performance is at least 2.5 times fasterβοΈ
https://t.me/pgimg/192
[ Github ] : kutt.it/mapster
[ Performance Benchmark ] : kutt.it/mapbnch
γ°οΈγ°οΈγ°οΈγ°οΈγ°οΈγ°οΈ
#Mapper #Mapster #CSharp
@ProgrammingTip
Telegram
Programming Tips Resources
Blazor, web framework for browser-based .NET apps π₯
Today, nearly all browser-based apps are written in JavaScript (or similar languages that transpile to it). ππ»
Thatβs fine, but thereβs no good reason to limit our industry to basically one language when so many powerful and mature alternate languages and programming platforms exist. β‘οΈ
Starting now, WebAssembly opens the floodgates to new choices, and one of the first realistic options may be .NET. π
Blazor is a new experimental web UI framework from the ASP.NET team that aims to brings .NET applications into all browsers (including mobile) via WebAssembly. β¨
It allows you to build true full-stack .NET applications, sharing code across server and client, with no need for transpilation or plugins. βπ»
In this talk Iβll demonstrate what you can do with Blazor today and how it works on the underlying WebAssembly runtime behind the scenes. π
Youβll see its modern, component-based architecture (inspired by modern SPA frameworks) at work as we use it to build a responsive client-side UI. π
Iβll cover both basic and advanced scenarios using Blazorβs components, router, DI system, JavaScript interop, and more. π
Don't miss this talk, that's awesome ! βοΈ
[ Video ] : kutt.it/blz
γ°οΈγ°οΈγ°οΈγ°οΈγ°οΈγ°οΈ
#Blazor #WebAssembly #CSharp
@ProgrammingTip
Today, nearly all browser-based apps are written in JavaScript (or similar languages that transpile to it). ππ»
Thatβs fine, but thereβs no good reason to limit our industry to basically one language when so many powerful and mature alternate languages and programming platforms exist. β‘οΈ
Starting now, WebAssembly opens the floodgates to new choices, and one of the first realistic options may be .NET. π
Blazor is a new experimental web UI framework from the ASP.NET team that aims to brings .NET applications into all browsers (including mobile) via WebAssembly. β¨
It allows you to build true full-stack .NET applications, sharing code across server and client, with no need for transpilation or plugins. βπ»
In this talk Iβll demonstrate what you can do with Blazor today and how it works on the underlying WebAssembly runtime behind the scenes. π
Youβll see its modern, component-based architecture (inspired by modern SPA frameworks) at work as we use it to build a responsive client-side UI. π
Iβll cover both basic and advanced scenarios using Blazorβs components, router, DI system, JavaScript interop, and more. π
Don't miss this talk, that's awesome ! βοΈ
[ Video ] : kutt.it/blz
γ°οΈγ°οΈγ°οΈγ°οΈγ°οΈγ°οΈ
#Blazor #WebAssembly #CSharp
@ProgrammingTip
Telegram
Programming Tips Resources
C# 8 Interfaces: Dangerous Assumptions in Default Implementation β οΈ
One of the features that is being promoted about C# 8 interfaces is that we can add members to an interface without breaking existing implementers. β
But we can cause a lot of pain if we aren't careful. π€·π»ββοΈ
Let's look at some code that makes bad assumptions so that we can understand the importance of avoiding these problems. βοΈ
[ Article ] : kutt.it/csdif
γ°οΈγ°οΈγ°οΈγ°οΈγ°οΈγ°οΈ
#CSharp #Interfaces
@ProgrammingTip
One of the features that is being promoted about C# 8 interfaces is that we can add members to an interface without breaking existing implementers. β
But we can cause a lot of pain if we aren't careful. π€·π»ββοΈ
Let's look at some code that makes bad assumptions so that we can understand the importance of avoiding these problems. βοΈ
[ Article ] : kutt.it/csdif
γ°οΈγ°οΈγ°οΈγ°οΈγ°οΈγ°οΈ
#CSharp #Interfaces
@ProgrammingTip
Telegram
Programming Tips Resources
Using the ReferenceAssemblies NuGet package to build .NET Framework libraries on Linux, without installing Mono π
In this post I show how you can build .NET projects that target .NET Framework versions on Linux, without using Mono! π€·π»ββοΈ
By using the new Microsoft.NETFramework.ReferenceAssemblies NuGet packages from Microsoft you don't need to install anything more than the .NET Core SDK! π₯
[ Article ] : kutt.it/coremono
γ°οΈγ°οΈγ°οΈγ°οΈγ°οΈγ°οΈ
#CSharp #DotNet #AspCore #NetCore
@ProgrammingTip
In this post I show how you can build .NET projects that target .NET Framework versions on Linux, without using Mono! π€·π»ββοΈ
By using the new Microsoft.NETFramework.ReferenceAssemblies NuGet packages from Microsoft you don't need to install anything more than the .NET Core SDK! π₯
[ Article ] : kutt.it/coremono
γ°οΈγ°οΈγ°οΈγ°οΈγ°οΈγ°οΈ
#CSharp #DotNet #AspCore #NetCore
@ProgrammingTip
Telegram
Programming Tips Resources
EasyCompressor π¦
EasyCompressor is an open-source compression abstraction library that supports and implements many compression algorithms such as Zstd, LZMA, LZ4, Snappy, Brotli, GZip and Deflate. π
It is very useful for using along with Distributed Caching or storing files in database. β
[ GitHub ] : github.com/mjebrahimi/EasyCompressor
γ°οΈγ°οΈγ°οΈγ°οΈγ°οΈγ°οΈ
#Compression #CSharp #DotNet
@ProgrammingTip
EasyCompressor is an open-source compression abstraction library that supports and implements many compression algorithms such as Zstd, LZMA, LZ4, Snappy, Brotli, GZip and Deflate. π
It is very useful for using along with Distributed Caching or storing files in database. β
[ GitHub ] : github.com/mjebrahimi/EasyCompressor
γ°οΈγ°οΈγ°οΈγ°οΈγ°οΈγ°οΈ
#Compression #CSharp #DotNet
@ProgrammingTip
Telegram
Programming Tips Resources
What is .NETβ
What's C# and F#β
What's the .NET Ecosystemβ
What can .NET buildβ
Learn what is .NET from Scott Hanselman! β
[ Youtube ] : https://www.youtube.com/watch?v=bEfBfBQq7EE
γ°οΈγ°οΈγ°οΈγ°οΈγ°οΈγ°οΈ
#DotNet #CSharp
@ProgrammingTip
What's C# and F#β
What's the .NET Ecosystemβ
What can .NET buildβ
Learn what is .NET from Scott Hanselman! β
[ Youtube ] : https://www.youtube.com/watch?v=bEfBfBQq7EE
γ°οΈγ°οΈγ°οΈγ°οΈγ°οΈγ°οΈ
#DotNet #CSharp
@ProgrammingTip
YouTube
What is .NET? What's C# and F#? What's the .NET Ecosystem? .NET Core Explained, what can .NET build?
What is .NET? What is C# and F#? What is .NET Core? What's the .NET Ecosystem? What can you build? You have questions and we have answers. More videos at http://dot.net/videos