Skip to content

Instantly share code, notes, and snippets.

View MeinLiX's full-sized avatar
🇺🇦

Yurii Hrohul MeinLiX

🇺🇦
  • Ukraine
  • 23:04 (UTC +03:00)
View GitHub Profile
static void Parser()
{
var src = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
if (src == null) throw new Exception();
src = Path.Combine(src, "..\\..\\..\\assets", "blocks.json");
var blocks = JsonConvert.DeserializeObject<Dictionary<string, Lava.Blocks.json.BlockInfo>>(File.ReadAllText(src));
List<string> b = new List<string>();
@MeinLiX
MeinLiX / Factorial C# MPI.net .cs
Last active June 7, 2021 09:14
.net 5, MPI factorial
using System;
using System.Diagnostics;
using System.Numerics;
MPI.Environment.Run(ref args, comm =>
{
if (comm.Rank == 0)
{
BigInteger x = BigInteger.Parse(args[0]);
BigInteger res = 1;
@MeinLiX
MeinLiX / SourceBFParser.cs
Last active May 18, 2021 19:04
Example parse status code by brute force web pages. C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Threading.Tasks;
namespace ParseCorrectPages
{
class Source
{
@MeinLiX
MeinLiX / DinningPhilosophers.cs
Last active June 7, 2021 10:29
Dining philosophers problem C#
using System;
using System.Collections.Generic;
using System.Threading;
namespace Project
{
class Program
{
private static List<Fork> fork = new ();
@MeinLiX
MeinLiX / ParallelFn.cs
Last active June 7, 2021 10:29
Parallel fn and operation ||
using System;
using System.Threading;
using System.Threading.Tasks;
namespace Project
{
class Program
{
private struct FnProp
{
@MeinLiX
MeinLiX / MutexTest.cs
Last active June 7, 2021 10:28
Mutex test c#
using System;
using System.Diagnostics;
using System.Threading;
namespace Project
{
class Program
{
private static readonly Mutex m = new ();
private const int N = 1000;
@MeinLiX
MeinLiX / StateExample.cs
Created June 7, 2021 10:31
State Example .NET 5
using System;
try
{
Client server = new (new Idle());
server.Click();
server.Success();
server.Click();
server.Failure();
server.Retry();
@MeinLiX
MeinLiX / ProcessLoader.cs
Last active October 12, 2021 15:45
Procces loader .net 6
using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
using System.Threading;
Enumerable.Range(1, 7).ToList().ForEach(n =>
{
static BigInteger factorial(BigInteger a, BigInteger b)
{
@MeinLiX
MeinLiX / RAMloader.cs
Created October 12, 2021 15:32
RAM loader .net 6
using System;
using System.Collections.Generic;
using System.Threading;
List<byte[]> buffer = new List<byte[]>();
List<string> Args = new(args);
bool showMessage = Args.Contains("-msg");
bool mbArg = false;
int maxMB = 0;
@MeinLiX
MeinLiX / Mat.java
Created October 24, 2021 22:05
mat
import java7.util.regex.Pattern;
public class MatMatcher {
private String[] words = new String[]{
//ass(es)?
"a[\\W_]*s[\\W_]*s(?:[\\W_]*e[\\W_]*s)?",
//fuck(ing)?
"f[\\W_]*u[\\W_]*c[\\W_]*k(?:[\\W_]*i[\\W_]*n[\\W_]*g)?",
//ж(ыд(у|ов)?|оп(а(х)?|у|ой))
"ж[\\W_]*(?:[ыиiu][\\W_]*[дd](?:[\\W_]*[уыаyiau]|[\\W_]*[оo0][\\W_]*[вbv])?|[оo0][\\W_]*[пnp][\\W_]*(?:[аa](?:[\\W_]*[хxh])?|[уеыeyiu]|[оo0][\\W_]*[йj]))",