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
| package main | |
| // The program takes corpora in txt and csv formats and generates a word frequency list, as well as n-gram lists. | |
| // The word frequency list can be used for Cyanophage, while n-grams are in a format suitable for dariogoetz's Keyboard Layout Optimizer. | |
| // The program goes through 7 GB of text in 10 minutes. | |
| // I wrote it in Odin because I'm practicing it, but also because any naive implementation in a compiled language will be better than Python. | |
| // The following corpora were used for Ukrainian: | |
| // https://github.com/kateryna-bobrovnyk/ukr-twi-corpus | |
| // https://lang.org.ua/en/ubertext/ (wikipedia & fiction, split into sentences) |
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
| [StructLayout(LayoutKind.Auto)] | |
| public struct HashMap<TKey, TValue> where TKey : IEquatable<TKey> | |
| { | |
| [StructLayout(LayoutKind.Auto)] | |
| public struct Entry | |
| { | |
| public int Hash; // 0 == empty | |
| public int Dib; // distance-to-initial-bucket for this slot (0 for home) | |
| public TKey Key; | |
| public TValue Value; |
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; | |
| using System.Collections.Generic; | |
| using System.Diagnostics; | |
| using System.Diagnostics.CodeAnalysis; | |
| using System.Runtime.CompilerServices; | |
| using System.Runtime.InteropServices; | |
| using System.Runtime.Serialization; | |
| using System.Threading; | |
| using Unity.Burst; |
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 Sirenix.OdinInspector; | |
| using UnityEngine; | |
| using UnityEngine.Assertions; | |
| using Debug = UnityEngine.Debug; | |
| namespace SolidAlloy | |
| { |
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
| #Requires AutoHotkey v2.0 | |
| ; Makes Shift+Alt skip Japanese | |
| ~+Alt:: | |
| { | |
| sleep(150) | |
| if (GetKeyboardLanguage(WinExist("A")) = 1041) { | |
| Send "{Shift Down}{Alt}{Shift Up}" | |
| } | |
| } |
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.Linq; | |
| using UnityEditor; | |
| using UnityEditor.SceneManagement; | |
| using UnityEngine; | |
| using UnityEngine.SceneManagement; | |
| using vietlabs.fr2; | |
| // I was frustrated with the fact that RectTransform fields are often marked as overriden when prefab instances |
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.IO; | |
| using JetBrains.Annotations; | |
| using NUnit.Framework; | |
| using UnityEditor; | |
| using UnityEngine; | |
| using Object = UnityEngine.Object; | |
| /// <summary> | |
| /// Unit tests that show how AssetDatabase operates. |
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.Runtime.CompilerServices; | |
| using JetBrains.Annotations; | |
| // Reduced-down and slightly refactored version of https://gist.github.com/LordJZ/92b7decebe52178a445a0b82f63e585a | |
| // It exposes only (T separator) overload of the Split method which was enough for my needs. | |
| public static class SpanExtensions | |
| { | |
| public readonly ref struct Enumerable<T> | |
| where T : IEquatable<T> |
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.IO; | |
| using System.Text.RegularExpressions; | |
| using UnityEditor; | |
| using UnityEngine; | |
| [InitializeOnLoad] | |
| internal static class RoslynDirectoryCreator | |
| { | |
| static RoslynDirectoryCreator() => Application.logMessageReceived += OnLogMessageReceived; |
NewerOlder