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
| # collection of C# macro functions. | |
| # credits: boostyourbim, archilizer, archsmarter, don rudden | |
| # ADN-DevTech/RevitTrainingMaterial |
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
| #LINQPad optimize+ | |
| //https://blog.marcgravell.com/2018/01/sorting-myself-out-extreme-edition.html | |
| //https://stackoverflow.com/questions/66631585/efficient-comparison-of-2-integers-against-another-2 | |
| //https://github.com/Treit/MiscBenchmarks/blob/main/MinMaxNumericValues/Benchmark.cs | |
| //https://medium.com/@norm.bryar/faster-use-of-bool-f541d349fce4 | |
| //https://www.extremeoptimization.com/Documentation/Vector-and-Matrix/Vectors/Accessing-vector-elements.aspx | |
| //https://github.com/dotnet/fsharp/issues/13098 | |
| //https://github.com/CBGonzalez/SIMDIntro | |
| //https://github.com/dotnet/fsharp/issues/13098 |
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
| #LINQPad optimize+ | |
| //https://blog.marcgravell.com/2018/01/sorting-myself-out-extreme-edition.html | |
| //https://stackoverflow.com/questions/66631585/efficient-comparison-of-2-integers-against-another-2 | |
| //https://github.com/Treit/MiscBenchmarks/blob/main/MinMaxNumericValues/Benchmark.cs | |
| //https://medium.com/@norm.bryar/faster-use-of-bool-f541d349fce4 | |
| //https://www.extremeoptimization.com/Documentation/Vector-and-Matrix/Vectors/Accessing-vector-elements.aspx | |
| //SmallTest st = new SmallTest(); | |
| //st.GlobalSetup(); | |
| //st.OrdinaryMax().Dump(); |
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 ILGPU; | |
| using ILGPU.Runtime; | |
| using ILGPU.Runtime.CPU; | |
| using ILGPU.Runtime.Cuda; | |
| using SixLabors.ImageSharp; | |
| using SixLabors.ImageSharp.PixelFormats; | |
| using System.Diagnostics; | |
| namespace ColorCounter | |
| { |
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
| //(int)('s'-'a')= 18 | |
| //sizeof(uint) ==4 | |
| uint[] a = new[] { 623462994u/*5*/, 18u/*1*/, 576u/*1*/, 594u /*2*/, 14u /*0*/ }; //Number denotes number of S's | |
| var charCount = new[] { (uint)0b0011_10010/*, (uint)0b01_10010, (uint)0b01_10010, (uint)0b01_10010*/ }; //This can hold the minimum and maximum occurrences of the letter overall. | |
| //0b0011_10010, at least 0 's', no more than 3 's'. | |
| var result = WordCheck(a, charCount); | |
| a.Dump("Final Answer"); | |
| unsafe uint WordCheck(uint[] left, uint[] 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
| using System; | |
| using System.Collections.Generic; | |
| using System.Diagnostics; | |
| using System.Linq; | |
| using Microsoft.Xna.Framework; | |
| using Microsoft.Xna.Framework.Graphics; | |
| using Microsoft.Xna.Framework.Input; | |
| namespace MonoTest | |
| { |
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
| //This is an example of how to scrape the web using PhantomJS and jQuery: | |
| //source: http://snippets.aktagon.com/snippets/534-How-to-scrape-web-pages-with-PhantomJS-and-jQuery | |
| //http://phantomjs.org/ | |
| var page = new WebPage(), | |
| url = 'http://localhost/a-search-form', | |
| stepIndex = 0; | |
| /** | |
| * From PhantomJS documentation: |