vasar007 / acolyte.net Goto Github PK
View Code? Open in Web Editor NEWAcolyte.NET is a helper library with a lot of useful classes and extension methods that you need in your everyday work.
License: Apache License 2.0
Acolyte.NET is a helper library with a lot of useful classes and extension methods that you need in your everyday work.
License: Apache License 2.0
Need to replace all raw enumerable methods like MoveNext
and Current
with C# statements using
and foreach
. Also we can use LINQ methods if needed.
Is your feature request related to a problem? Please describe.
Need to add class MonitorList
to observe values in collections.
Describe the solution you'd like
Collection wrapper (proxy pattern) which can track changes and return changes ligt on request. Underlying collections should be anything.
Describe alternatives you've considered
Some time ago I have already implemented this class but I lost it, unfortunately.
Additional context
Do not forget to add tests.
Is your feature request related to a problem? Please describe.
Process
class from .NET has some pitfalls. To resolve them need to add additional wrapper which can handle some cases instead of final user.
Describe the solution you'd like
ProcessHolder
has been already implemented by me here.
Describe alternatives you've considered
Try to find some other useful methods in the Internet.
Additional context
Do not forget to add tests.
Is your feature request related to a problem? Please describe.
Class Acolyte.Collections.EnumerableExtensions
contains a lot of lines of code. Need to split this large file.
Describe the solution you'd like
I should split class based on regions like in Linq
.NET repository.
Describe alternatives you've considered
None.
Additional context
Do not forget to update tests. All methods in Acolyte.Collections.EnumerableExtensions
class and it's all methods should be marked as Obsolete
(will be removed in the next major version).
Is your feature request related to a problem? Please describe.
There are some cases when .NET BCL is not enough to work with pathes. So, some helper methods will be useful (e.g. Path.GetFileName(Path.GetDirectoryName(path))
).
Describe the solution you'd like
I have already written some methods in project AlgorithmAnalysis. E.g. here.
Describe alternatives you've considered
Try to find some other useful methods in the Internet.
Additional context
Do not forget to write tests.
Is your feature request related to a problem? Please describe.
One of the popular pattern — state machine. It will be useful if our package will contain it.
Describe the solution you'd like
I have already implemented state machine here.
Describe alternatives you've considered
None.
Additional context
Do not forget to add tests for new package.
Is your feature request related to a problem? Please describe.
Need to add tests methods for all methods and classes in public API.
Is your feature request related to a problem? Please describe.
Interop and COM-objects should be released at the end of usage. However, there are some issues which users should know and avoid. For this purpose need helper class which can handle it by itself.
Describe the solution you'd like
I have already implemented such class here.
Describe alternatives you've considered
Try to find some other useful methods in the Internet.
Additional context
Do not forget to write tests.
Is your feature request related to a problem? Please describe.
We already have nice parallel ForEach async-like functions that can start bunch of tasks on collection. But there are too few methods to cover all usages.
Describe the solution you'd like
So, we should extend this API according to overloads in System.Linq.Async package (AsyncEnumerable class here)
Describe alternatives you've considered
None.
Additional context
Do not forget to add tests and documentation for new methods.
Is your feature request related to a problem? Please describe.
It is not so convinient to create threads manually. I think some helper class for threads will be useful.
Describe the solution you'd like
Common class (may be static) which can create and manage threads. I have already implemented some primitives here.
Describe alternatives you've considered
None.
Additional context
Do not forget to add tests.
Is your feature request related to a problem? Please describe.
Need to add methods for working with strings (filtering, changing, converting).
Describe the solution you'd like
I have already written some methods in project AlgorithmAnalysis.
Describe alternatives you've considered
Try to find some other useful methods in the Internet.
Additional context
Do not forget to add tests.
Is your feature request related to a problem? Please describe.
Acolyte.CSharp
package contains a lot of different useful code. However, this package cannot be extended infinately. And what if users do not want the whole package but only one of it features?
Describe the solution you'd like
Need to create NuGet package hierarchy as Microsoft did with therir own NuGet packages. Finally, we reamain Acolyte.CSharp
and Acolyte.FSharp
projects which will be worked as Acolyte.NET
— this projects will not contain any code, just links to the other packages.
Describe alternatives you've considered
None.
Additional context
Do not forget to add links to the other packages in this repository.
Is your feature request related to a problem? Please describe.
Need to replace Acolyte.Common.HashCode
with Microsoft.Bcl.HashCode
.
Describe the solution you'd like
We can reuse common logic from package Microsoft.Bcl.HashCode
. In additon, need to add several static methods to cover cases for collections and e.t.c.
Describe alternatives you've considered
None.
Additional context
Do not forget to add tests for new logic.
Is your feature request related to a problem? Please describe.
Need to add XML docstrings for all methods and classes in public API.
Describe the bug
System.Random
class is not thread-safe. So, we should refactor Acolyte.Basic.Randomness.ThreadSafeRandom
to use singleton System.Random
class for seed generation to avoid the issue when several Acolyte.Basic.Randomness.ThreadSafeRandom
class created simultaneously (using default ctor = seed will be generated randomly) will have the same seed value.
Read about it more here.
To Reproduce
Example from the article mentioned above:
using System;
using System.Linq;
using System.Threading.Tasks;
using Acolyte.Basic.Randomness;
// ⚠ This isn't safe in .NET Framework, don't do it ⚠
Parallel.For(0, 10, x => // run in parallel
{
TheadSafeRandom rng = new(); // 👈 create a private TheadSafeRandom instance
var numbers = new int[10_000];
for (int i = 0; i < numbers.Length; ++i)
{
numbers[i] = rng.Next(); // Fetch 10,000 random numbers
}
var numZeros = numbers.Count(x => x == 0); // how many issues were there?
Console.WriteLine($"Received {numZeros} zeroes"); // always 0 issues
});
Expected behavior
Acolyte.Basic.Randomness.ThreadSafeRandom
class should use singleton Random
class for seed generation.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.