0.001096, 0.101212, 0.2020205, 0.3030929, 0.4042182, 0.5052511, 0.6066207, 0.7077272, 0.8092904, 0.9107451
This file contains 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
namespace SimulatedAnnealing; | |
public class Tests | |
{ | |
[TestCase(new[] { 6, 1, 9, 14, 19, 11, 0, 12, 8, 3, 5, 2, 4, 7, 10, 16, 15, 17, 18, 13, }, | |
new[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 }, 300000)] | |
public void CanSort(int[] source, int[] expected, int kMax) | |
{ | |
var random = new Random(123); | |
ISolver sa = new SimulatedAnnealing(kMax, random); |
This file contains 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.Collections.Concurrent; | |
using System.Linq.Expressions; | |
using System.Runtime.CompilerServices; | |
namespace DelegateIdentifier; | |
public class Tests | |
{ | |
private const int n = 3; | |
private const int nIter = 10_000_000; |
This file contains 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
<Project InitialTargets="EmbedFileAsStringResources"> | |
<Target Name="EmbedFileAsStringResources" | |
BeforeTargets="Build"> | |
<ItemGroup> | |
<EmbeddedResource Include="@(FileAsStringResource)"> | |
<LogicalName>%(Identity)</LogicalName> | |
<ManifestResourceName>%(Identity)</ManifestResourceName> | |
</EmbeddedResource> | |
</ItemGroup> | |
</Target> |
This file contains 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.Runtime.InteropServices; | |
[StructLayout(LayoutKind.Explicit)] | |
struct FieldList | |
{ | |
[FieldOffset(0)] private int _item0; | |
[FieldOffset(4)] private int _item1; | |
[FieldOffset(8)] private int _item2; | |
[FieldOffset(12)] private int _item3; |
This file contains 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
<svg width="100%" height="100%" | |
xmlns="http://www.w3.org/2000/svg"> | |
<filter id="reshape"> | |
<feGaussianBlur stdDeviation="30"/> | |
<feComponentTransfer> | |
<feFuncA type="linear" slope="30.0" intercept="-10"/> | |
</feComponentTransfer> | |
</filter> | |
<g id="targetGroup" style="filter: url(#reshape);"> |
This file contains 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
public double[] FeedForward(double[] inputs) | |
{ | |
for (int i = 0; i < inputs.Length; i++) | |
{ | |
neurons[0][i] = inputs[i]; | |
} | |
for (int i = 1; i < layers.Length; i++) | |
{ | |
for (int j = 0; j < neurons[i].Length; j++) |
This file contains 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
void Main() | |
{ | |
long countDone = 0; | |
using (var pool = new FixedThreadPool(16)) | |
{ | |
pool.WaitForThreadInitialization(); | |
var totalDepth = 9; | |
var total = (2L << totalDepth) - 1; |
This file contains 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
<?xml version="1.0" encoding="utf-8"?> | |
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
<PropertyGroup> | |
<TasksDllPath Condition="'$(MSBuildToolsVersion)' == '14'">$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll</TasksDllPath> | |
<TasksDllPath Condition="'$(MSBuildToolsVersion)' != '14'">$(MSBuildToolsPath)\Microsoft.Build.Tasks.v$(MSBuildToolsVersion).dll</TasksDllPath> | |
</PropertyGroup> | |
<UsingTask TaskName="InspectSourceCode" | |
TaskFactory="CodeTaskFactory" | |
AssemblyFile="$(TasksDllPath)"> | |
<ParameterGroup> |
This file contains 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
<Import Project="$(SolutionDir)\CustomBuildTargets.proj" /> | |
<Import Project="$(SolutionDir)\FormattingInspections.proj" /> | |
<Target Name="BeforeBuild" DependsOnTargets="RunSourceCodeInspections;PerformVersioning"> | |
</Target> |
NewerOlder