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
open System | |
open System.IO | |
let num () = Random.Shared.Next(0, 10_000) | |
let alf = | |
[| ' ' |] | |
|> Array.append [| 'A' .. 'Z' |] | |
|> Array.append [| 'a' .. 'z' |] |
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.Diagnostics; | |
using static System.Console; | |
var sw = Stopwatch.StartNew(); | |
var alf = get_alf(); | |
do_it(2_000_000); | |
sw.Stop(); | |
WriteLine(sw.Elapsed); // <= 00:00:13.4216229 it is very fast! fantasctic! | |
char[] get_alf() |
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
/* | |
2_000_000 => 16 sec | |
5_ => 32 | |
10_ => 1:10 | |
20_ => 2:58 | |
40_ => 13:44 file size = 2.5 Gb | |
*/ | |
using System.IO; | |
using System.Diagnostics; |
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
#r "nuget: FSharp.Data, 5.0.2" | |
open System | |
open System.Diagnostics | |
open FSharp.Data | |
open System.IO | |
let [<Literal>] feedUrl = "https://peapix.com/bing/feed" | |
type BingoImage = JsonProvider<feedUrl> | |
let out = Path.Combine(__SOURCE_DIRECTORY__, "bing") |
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
(* | |
Для запуска на виднос выполнить команду: | |
dotnet fsi --exec githubEvents.fsx | |
*) | |
#r "nuget: FSharp.Data" | |
open FSharp.Data | |
let [<Literal>] url = "https://api.github.com/networks/radzenhq/radzen-blazor/events" | |
type Events = JsonProvider<url> |
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
module ZenUtil | |
#r "nuget: NAudio" | |
#r "nuget: System.Speech" | |
open NAudio.Wave | |
open System | |
module WindowsSpeech = |
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
<MudButton ButtonType="ButtonType.Button" OnClick="BeepIfIncomingMessage">OK</MudButton> | |
@code { | |
async Task BeepIfIncomingMessage() | |
{ | |
if (jsSoundUtils == null) | |
jsSoundUtils = await JS.InvokeAsync<IJSObjectReference>("import", "./js/SoundUtils.js"); | |
var res = await jsSoundUtils.InvokeAsync<object>("soundBeep"); | |
} |
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
open System | |
type Message<'a> = | |
| Get of AsyncReplyChannel<'a> | |
| Update of AsyncReplyChannel<'a> * ('a -> 'a) | |
type Atom<'a>(o: 'a) = | |
let agent = | |
MailboxProcessor.Start(fun b -> | |
let rec loop (acc) = |
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
@page "/" | |
@rendermode InteractiveServer | |
<input value="@query" @oninput="OnInput" /> | |
@if (isGetItems) | |
{ | |
<div style="font-style: italic;">поиск...</div> | |
} | |
else |
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
// controller | |
[HttpGet("tgCheckWebAppAuth")] | |
public async Task<IActionResult> CheckWebAppAuth([FromQuery] Dictionary<string, string> userData) | |
{ | |
var user = telegramLoginUrl.CheckWebAppTelegramAuthorization(userData); | |
if (await Invalid(user)) return Unauthorized(); | |
await SignIn(user, [new Claim("Source", "TelegramWebApp")]); |