How to create a 2 column Flexbox layout in React Native

Creating a two column layout in React Native, given a list of items, is quite a common task. This react native 2 column layout can be achieved quite easily using flex. The examble below shows how to achieve the two-column layout with spacing between the elements. This is our view: And this is our style:…

| |

C# ZIP files to Stream

.NET 8 include new CreateFromDirectory overloads which enable you to create a ZIP file without writing them to disk. This is particularly useful in situations where you don’t want to store the zipped resources, you use the Zip content only for transfer. For example: if you were to provide an API allowing multi-file download. That…

.NET 8 performance: 10x faster GetGenericTypeDefinition
| |

.NET 8 performance: 10x faster GetGenericTypeDefinition

.NET 8 brings some neat performance for existing APIs that handle type information. One such API that has seen a significant improvement is GetGenericTypeDefinition. In my benchmarks, the .NET 8 implementation is almost 10 times faster compared to the .NET 7 version. You can run this benchmark yourself if you’d like using BenchmarkDotNet: Or if…

Kebab case – everything about it and more

Kebab case is a naming convention used in programming to format variable, function, or file names by separating words with hyphens (“-“). It is also known as “kebab-case”, “hyphen-case”, or “spinal-case”. For example, if you have a variable representing a person’s first name, you would write it in kebab case as: In kebab case, all…

| |

C# How to update a readonly field using UnsafeAccessor

Unsafe accessors can be used to access private members of a class, just like you would with reflection. And the same can be said about changing the value of a readonly field. Let’s assume the following class: Let’s say that for some reason you want to change the value of that read-only field. You could…

.NET 8 Performance: UnsafeAccessor vs. Reflection
| |

.NET 8 Performance: UnsafeAccessor vs. Reflection

In a previous article we covered how to access private members using UnsafeAccessor. This time around, we want to look at it’s performance compared to Reflection, and to see whether it’s truly zero-overhead or not. We’re going to do four benchmarks. If you want to run the benchmarks yourself, you have the code below: Benchmark…

|

How to access private members without reflection in C#

Reflection allows you to obtain type information at runtime and to access private members of a class using that information. This can be particularly useful when dealing with classes outside of your control – provided by a third-party package. While powerful, reflection is also very slow, which is one of the main deterrents in using…

How to fix: MissingPluginException – No implementation found for method getAll

This is quite a common issue that usually occurs in flutter release builds. More often than not the issue is caused by ProGuard stripping away some required APIs at build time, leading to missing implementation exceptions such as the one below. That being said, there are actually multiple possible causes to this issue, as such…

C# – How to mark features as experimental
| |

C# – How to mark features as experimental

Starting with C# 12, a new ExperimentalAttribute is introduced allowing you to mark types, methods, properties or assemblies as being experimental features. This will trigger a compiler warning during usage which can be disabled using a #pragma tag. The Experimental attribute requires a diagnosticId parameter to be passed in the constructor. That diagnostic ID will…

What comes after decillion?

What comes after decillion?

This is quite a frequent question. You’ve got: But what comes after decillion? The answer is: undecillion. An undecillion, has 36 zeroes. That’s a lot of zeroes: 1,000,000,000,000,000,000,000,000,000,000,000. But there’s more. If you look past the undecillion, you’ve got: Interested in how long it would take a PC to count to a trillion? Check out this…