Skip to content

neomasterhub/Neomaster.Demos

Repository files navigation

🧪 DEMOS

TL;DR

Examples, Experiments, Research
Look. Try. Add.

About

👋 Welcome! This is the personal repository of a Full-Stack developer (.NET, C++, Angular), where I collect everything I’ve learned or discovered in real projects.

🔬 I don’t just read theory – I want to see how it works in practice! Here you’ll find hands-on examples of basic tools and practical solutions to complex problems you can try yourself.

💡 Even simple concepts are easy to forget, and revisiting them often means writing small console projects. To save time and stay organized, I keep everything in one structured place.

🤝 I’m open to collaboration!

📦 This repository is my personal experience vault, which will continue to grow. New examples, ideas, and practices appear as I learn and work on real projects.

Small for now 🌱 but growing with each step toward something greater 🌳!

.NET

Note: Tests containing spin or yield may fail depending on the CPU.

📦 Archives

Zip

  1. Create 1 root file
  2. Create N root files
  3. Create N folder files
  4. Create Word doc
🔀 Threads

1. Fundamentals

  1. Create, Sleep, Join
  2. Create with arg
  3. Foreground
  4. Background
  5. Info, current thread instance
  6. Is alive
  7. Join with timeout
  8. Abort
  9. Affinity (run parameter)
  10. Affinity (programmatically)
  11. Suspend, Resume
  12. Suspend, Resume: Tick Tock
  13. Abort in Core via CancellationTokenSource
  14. Suspend-Resume in Core via ManualResetEventSlim
  15. Tick Tock in Core

2. Synchronization

  1. lock()
  2. Monitor.Enter - Monitor.Exit
  3. Wait Queue
  4. Monitor.PulseAll
  5. Monitor.Pulse
  6. Tick Tock via Monitor.Pulse - Monitor.Wait
  7. Monitor.Wait with timeout as Sleep
  8. SpinLock vs lock()
  9. Spin lock as Sleep
  10. Spin lock for fast logging
  11. Spin lock throwing SynchronizationLockException
  12. Thread.Yield: fast cycle
  13. Thread.SpinWait: fast cycle
  14. SpinWait.SpinOnce
  15. SpinWait.SpinUntil
  16. Semaphore.WaitOne - Release
  17. Semaphore.Release max slots
  18. Semaphore: named for processes
  19. Semaphore: named created new
  20. Mutex as Monitor
  21. Mutex for singleton thread
  22. Mutex for singleton app
  23. Interrupt
  24. Deadlock: recursive locking
  25. Deadlock: mutual waiting, break by Interrupt
  26. Deadlock: mutual waiting, break by Join with timeout

3. Event Synchronization

  1. EventWaitHandle.Set
  2. EventWaitHandle.Reset
  3. EventWaitHandle.Set with auto-reset
  4. AutoResetEvent.Set
  5. ManualResetEvent.Set
  6. ManualResetEventSlim.Set
  7. ManualResetEventSlim.Wait with timeout
  8. CountdownEvent.Wait as Join
  9. CountdownEvent.AddCount
  10. CountdownEvent.TryAddCount
  11. CountdownEvent.IsSet
  12. CountdownEvent.Reset
  13. CountdownEvent.Reset with arg
  14. Barrier: Phases
  15. CancellationToken: create token
  16. CancellationToken: cancellation request
  17. CancellationToken: cancellation callback sequence
  18. CancellationToken: cancellation callback sequence: before first exception
  19. CancellationToken: cancellation callback sequence: all, ignoring exceptions
  20. CancellationToken.ThrowIfCancellationRequested
  21. CancellationToken.None usage
  22. CancellationToken.None variants
  23. CancellationTokenSource.CreateLinkedTokenSource

4. Thread Pool

  1. QueueUserWorkItem
  2. QueueUserWorkItem with state
  3. QueueUserWorkItem Join
  4. Set pool thread as foreground
  5. Pool restores thread as background

Atomic Operations

  1. Volatile class
  2. Volatile keyword
  3. Interlocked Increment

Features

  1. Synchronized method: instance
  2. Synchronized method: static
  3. Synchronized method: instance in different threads
  4. Synchronized method: static in different threads
  5. ThreadLocal<T>: counters
  6. Lazy<T>: lazy initialization
  7. Lazy<T>: single initialization
  8. Lazy<T>: multiple initialization
  9. Lazy<T>: unsafe initialization
  10. Note: disposable sync primitives
📋 Tasks

1. Fundamentals

  1. Create task
  2. Task is in pool thread
  3. Wait task
  4. Wait task with timeout
  5. Task is running after wait timeout
  6. Wait task with cancellation token
  7. Wait blocks thread
  8. Wait wraps task exception into AggregateException
  9. Result
  10. Result blocks thread
  11. Result wraps task exception into AggregateException
  12. Delay
  13. Delay with cancellation token
  14. Delay is working after wait timeout
  15. await releases manual thread
  16. await releases pool thread
  17. Method with async, without await is synchronous
  18. Method with async, with await is asynchronous
  19. ConfigureAwait
  20. ConfigureAwait: effect on default sync context Post and Send
  21. ConfigureAwait: effect on UI sync context Post and Send
  22. Throwing task exception
  23. ContinueWith: created task status
  24. ContinueWith: task chain
  25. ContinueWith: variable continuation
  26. ContinueWith: continuation options
  27. ContinueWith: SetInterval(
  28. RunSynchronously
  29. RunSynchronously and continuation
  30. RunSynchronously and synchronous continuation
  31. RunSynchronously continuation
  32. Set status to TaskStatus.Canceled after cancellation by Token.ThrowIfCancellationRequested()
  33. WhenAll
  34. WhenAll: task exceptions
  35. WhenAll with canceled task
  36. WhenAll with incorrect canceled task
  37. WaitAll
  38. WaitAll: task exceptions
  39. WhenAny
  40. WhenAny: timeout
  41. WhenAny: task exception
  42. WaitAny
  43. WaitAny: task exception
  44. WhenEach
  45. Yield
  46. Awaiter: GetResult
  47. Awaiter: OnCompleted
  48. Awaiter: pattern
  49. Awaiter: timespan awaiter
  50. TaskCompletionSource: timeout
  51. TaskCompletionSource: WithTimeout() extension
  52. TaskCompletionSource: external event source adapter
  53. FromResult
  54. FromCanceled
  55. FromException
  56. CompletedTask
  57. ValueTask: cached result
  58. Factory
  59. Factory: continuations
  60. Factory: TaskCreationOptions.LongRunning
  61. Factory: child task attachment, TaskCreationOptions.DenyChildAttach
  62. Factory: set task schedulers

2. Synchronization

  1. lock within task
  2. Task within lock
  3. Lock via semaphore

Features

  1. Timer: Callback
  2. Timer: AutoReset: false
  3. Timer: Alarms
  4. Parallel: For()
  5. Parallel: Stop()
  6. Parallel: Break()
  7. Parallel: Local Var
  8. Parallel: Exception
  9. Parallel: ParallelOptions
  10. Parallel: State Checks
  11. Parallel: Foreach()
  12. Parallel: Invoke()
🔗 LINQ

Expressions

  1. Tree structure: view
  2. Tree structure: create: left operand via Expression.MakeMemberAccess
  3. Tree structure: create: left operand via Expression.Property
  4. Tree structure: create: 3 levels
  5. Lambda: create Func1
  6. Lambda: create Func2
  7. Lambda: parameter order
  8. Lambda: info
  9. Lambda: view with named parameters
  10. Lambda: typed vs untyped
  11. Lambda: DynamicInvoke(): dynamic Func
  12. Lambda: DynamicInvoke(): dynamic Add
  13. ExpressionType: list of all
  14. Debug view
  15. Debug view: lambda
  16. Reduce()
  17. ReduceAndCheck(): reducible
  18. ReduceAndCheck(): not reducible
  19. ReduceAndCheck(): prevent return null and this
  20. ReduceExtensions(): builtin root
  21. ReduceExtensions(): custom root: reducible
  22. ReduceExtensions(): custom root: not reducible
  23. IsByRef: struct parameter: with ref modifier
  24. IsByRef: reference parameter: without ref modifier
  25. IsByRef: reference parameter: with ref modifier
  26. Visitor: root
  27. Visitor: tree: immutable
  28. Visitor: tree: with mutable child node
  29. Expression.Invoke
  30. Expression.Call: instance method
  31. Expression.Call: static method
  32. Expression.New
  33. Expression.MemberInit, Expression.Bind
  34. Expression.MemberBind
  35. Expression.Quote: lambda returns lambda
  36. Expression.Quote: lambda returns lambda: in DB provider
  37. Expression.Assign
  38. Expression.Block, Expression.Variable: Swap(x, y)
  39. Expression.Block returns last expression result
  40. Conditional operators
  41. Expression.Throw
  42. Expression.Goto, Expression.Label: empty
  43. Expression.Goto, Expression.Label: instruction
  44. Expression.Goto, Expression.Label: return value
  45. Expression.Return like Expression.Goto
  46. Expression.Return vs Expression.Goto: semantic difference
  47. Expression.Return vs Expression.Goto: call via kind
  48. Expression.Loop, Expression.Break: power to 10
  49. Expression.Loop, Expression.Break: select even
  50. GotoExpressionKind: list of all
  51. Expression.TryCatchFinally
  52. Reverse Polish Notation
  53. Auto-mapper
  54. SQL generation

Methods

  1. Enumerable and Queryable method names
  2. Enumerable.Range()
  3. Enumerable.Repeat()
  4. Enumerable.Empty()
  5. Aggregate()
  6. AggregateBy()
  7. All()
  8. Any()
  9. All with Any()
  10. Any with All()
  11. Append()
  12. Average()
  13. Cast(): numbers
  14. Cast(): classes
  15. Chunk()
  16. Concat()
  17. Contains()
  18. Count()
  19. CountBy()
  20. DefaultIfEmpty()
  21. Distinct()
  22. DistinctBy()
  23. ElementAt()
  24. ElementAtOrDefault()
  25. Except()
  26. ExceptBy()
  27. First()
  28. FirstOrDefault()
  29. GroupBy()
  30. GroupBy(): element selector
  31. GroupBy(): result selector
  32. GroupJoin()
  33. Index()
  34. Intersect()
  35. IntersectBy()
  36. Join()
  37. Last()
  38. LastOrDefault()
  39. Max()
  40. Max(): exceptions
  41. MaxBy()
  42. MaxBy(): exceptions
  43. OfType()
  44. Order()
  45. OrderBy()
  46. OrderDescending()
  47. OrderByDescending()
  48. Prepend()
  49. Reverse()
  50. Select(): indexing
  51. SelectMany()
  52. SequenceEqual()
  53. Single()
  54. SingleOrDefault()
  55. Skip()
  56. SkipLast()
  57. SkipWhile()
  58. Sum()
  59. Take()
  60. TakeLast()
  61. TakeWhile()
  62. ThenBy()
  63. ThenByDescending()
  64. ToDictionary()
  65. ToLookup()
  66. TryGetNonEnumeratedCount()
  67. Union()
  68. UnionBy()
  69. Zip()

C++

🧱 Fundamentals

Introduction

  1. Hello, World; std:cout <<
  2. std::endl as arg
  3. std::endl as function
  4. std::ends
  5. std::cin.get
  6. std::getline
  7. std::cin >>
  8. string constructors
  9. string item accessors: [], at()
  10. #pragma once
  11. Get type name
  12. Pointer
  13. Pointer arg
  14. nullptr
  15. Operator ->

About

A personal collection of practical demos, experiments, and architectural patterns from learning and real projects, built by a Full-Stack Developer to share experience.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors