This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Dark Mode for the Le Monde web site at https://www.lemonde.fr/ | |
| Using Stylish Chrome Extension: https://chrome.google.com/webstore/detail/stylish-custom-themes-for/fjnbnpbmkenffdnngjfgmeleoegfcffe?hl=en | |
| With "URLs starting with:" = https://www.lemonde.fr/ | |
| */ | |
| @media(prefers-color-scheme:dark) | |
| { | |
| #Header .Header, .Nav, .Nav__sub-item, body, .main, .zone, section.article__heading, .article__paragraph, .article, .article--longform .article__title, .article--longform .article__heading, .article--featured .article__wrapper, .article__title, .article__sub-title, .article__desc, .insert, div.fw_most_read_recommendations, .fw_most_read_recommendations-article, a .fw_most_read_recommendations-article { | |
| background-color: #141414; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using Microsoft.CodeAnalysis; | |
| using Microsoft.CodeAnalysis.CSharp.Syntax; | |
| using System; | |
| using System.Collections.Generic; | |
| using System.IO; | |
| using System.Reflection; | |
| using System.Text; | |
| using Microsoft.CodeAnalysis.Text; | |
| namespace SourceGenLib |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Discussion about https://mastodon.social/@denisio@dotnet.social/110644302160625267 | |
| // Optimized version using AVX. From 4x to 10x faster than a simple version. | |
| // - nint for indexing | |
| // - Unsafe.Add | |
| // - Unrolling of 4 Vector256 + Or of the results to have only 1 branch per loop | |
| // - Finding the local index within the Vector256 without a loop using AVX movemask | |
| // Similar code can be done for Vector128 | |
| using System.Numerics; | |
| using System.Runtime.CompilerServices; | |
| using System.Runtime.InteropServices; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Comment about https://mastodon.social/@brandewinder@hachyderm.io/113064780292323247 | |
| // https://brandewinder.com/2024/09/01/should-i-use-simd-vectors/ | |
| using System.Numerics; | |
| using System.Runtime.InteropServices; | |
| using System.Runtime.Intrinsics; | |
| public class VectorProcessor | |
| { | |
| public static float Take2(float[] left, float[] right) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Bench Windows Terminal with a wall of 24-bits RGB ANSI scrolling chars | |
| using System.Diagnostics; | |
| using System.Runtime.InteropServices; | |
| using System.Text; | |
| var width = Console.WindowWidth; | |
| var height = Console.WindowHeight; | |
| var total = width * height; | |
| if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // From a discussion on mastodon https://mastodon.social/@antonz@c.im/112620103070756332 | |
| // This version: | |
| // * simplifies the setup (an inline array is already a Span) | |
| // * uses BinaryPrimitives.ReverseEndianness to batch writing the long to the buffer | |
| // * uses SkipLocalsInit on the ctor to avoid some zero init | |
| // Should be ~ 15% faster than the revised version with Span | |
| // Anyway most of the time is spent in DateTimeOffset.UtcNow and RandomNumberGenerator.Fill | |
| using System.Buffers.Binary; | |
| using System.Diagnostics.CodeAnalysis; | |
| using System.Runtime.CompilerServices; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <#@ template debug="false" hostspecific="false" language="C#" #> | |
| <#@ assembly name="System.Core" #> | |
| <#@ import namespace="System.Linq" #> | |
| <#@ import namespace="System.Text" #> | |
| <#@ import namespace="System.Collections.Generic" #> | |
| <#@ output extension=".txt" #> | |
| <# | |
| var vectors = new [] { "Vector64", "Vector128", "Vector256", "Vector512", "Vector", "Vector2", "Vector3", "Vector4" }; | |
| var templates = new string[0]; | |
| string genT; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // You need to configure your C# project with x86 or x64 platform (Tools\Configuration Manager\Create new Platform on the project) | |
| // otherwise the native libSkiaSharp.dll will not get copied | |
| using System; | |
| using System.IO; | |
| using SkiaSharp; | |
| namespace TestSkia | |
| { | |
| class Program | |
| { |
NewerOlder