Skip to content

Instantly share code, notes, and snippets.

View amir734jj's full-sized avatar
🎮
Working from home

Seyedamirhossein Hesamian amir734jj

🎮
Working from home
  • Microsoft, Redmond
  • United States
  • LinkedIn in/hesamian
View GitHub Profile
@amir734jj
amir734jj / array.fs
Created February 13, 2023 05:16
Practicing array in fsharp
open System
type 'a List =
| Nil
| Cons of 'a * 'a List
let single = Cons(12, Cons(2, Nil))
let rec last ls =
match ls with
@amir734jj
amir734jj / App.csproj
Created November 21, 2022 06:49
Running Az PowerShell modules in C# .NET 6
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
@amir734jj
amir734jj / out.tex
Last active November 20, 2022 03:26
Really large tkiz
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{geometry}
\geometry{a0paper, landscape, margin=1in}
\usepackage{algorithm}
\usepackage{algpseudocode}
\usepackage{amsmath,amssymb}
\usepackage{amsthm}
@amir734jj
amir734jj / First-components.txt
Created July 8, 2022 13:13
SCC components of First
Components of Phylum Graph: Grammar
Component #0
G[Grammar]'shared_info$epsilon
Component #1
G[Grammar]'shared_info
Component #2
G[Grammar]'shared_info$firstTable!
G[Grammar]'shared_info$firstTable
Component #3
grammar_first
public record Cfg<T>(T Root, HashSet<T> Vertices, HashSet<(T, T)> Edges) where T : IEquatable<T>
{
private Dictionary<(T, T), bool> reach => Reach();
private readonly Dictionary<T, HashSet<T>> dom = new();
private readonly Dictionary<T, HashSet<T>> pred = new();
/// <summary>
/// <see href="https://en.wikipedia.org/wiki/Dominator_(graph_theory)#Algorithms"/>
@amir734jj
amir734jj / Makefile
Created April 5, 2021 07:35
make: *** No rule to make target 'grammar.aps'. Stop.
SPECS=First Follow
EXAMPLES_PATH=../..
ROOT_PATH=../${EXAMPLES_PATH}
SCALAV=2.12
APSLIB=${ROOT_PATH}/lib/aps-library-${SCALAV}.jar
SCALA_FLAGS=.:${APSLIB}
APS2SCALA=${ROOT_PATH}/bin/aps2scala
.PHONY:
all: $(addsuffix Spec.compile, $(SPECS)) $(addsuffix Spec.run, $(SPECS))
@amir734jj
amir734jj / confluent-interview-questions.txt
Last active March 19, 2024 07:25
confluent-interview-questions
Glassdoor questions:
- Given a game to you which is running on an instance and hasMySQL installed on it locally, now with the game popularity increasing, suggest ways that it stays highly secure and highly available and then with every step he was adding more things on it, like we want to use JWT on it, should we use it? session maintenance etc.
- URL shortener in Go
- MRU cache implementation in java or Go
- Distributed Systems, Coding Comprehension
- garbage collection in Java
- SFDC related experience
- debounce function
- Memory management for Java applications
"A,B\na,b".split(/\r?\n/).map(x => x.split(',').map(x => `"${x}"`).join(',')).join('\n')
@amir734jj
amir734jj / curry-compose.cs
Created March 10, 2019 17:43
csharp functional extensions
public static Func<TArg1, Func<TArg2, TResult>> Curry<TArg1, TArg2, TResult>(this Func<TArg1, TArg2, TResult> source)
{
return x => y => source(x, y);
}
public static Func<TArg1, Func<TArg2, Func<TArg3, TResult>>> Curry<TArg1, TArg2, TArg3, TResult>(this Func<TArg1, TArg2, TArg3, TResult> source)
{
return x => y => z => source(x, y, z);
}
import asyncio
from time import sleep
from threading import Thread, Lock
from .task_model import Task
from typing import List
lock = Lock()
class TaskManager: