luccasa / nextends Goto Github PK
View Code? Open in Web Editor NEWExtension des assemblies C#
Extension des assemblies C#
Improve performance of the string replace method (remove regex usage)
Remove pseudo benchmark based on StopWatch and use https://github.com/Microsoft/xunit-performance
Implementation differs between NExtends and Lucca. Should be harmonized and tested.
In StringExtensions, all the Operand methods should be removed from NExtends.
We should only keep generic methods about strings.
Je vous propose d'introduire un type Date, qui correspond à une Date sans notion d'heure. Ca n'existe pas en C#, alors que ça existe en SQL (via la précision d'une Date), et que ça existe dans la vie réelle (date de début de contrat n'a pas d'heure, alors que date de création en a une).
Ca permettra de tout de suite savoir si une date en C# est stockée en Date ou en DateTime en SQL, càd si elle a la précision des heures, et ainsi par ex éviter de lui initialiser des heures alors qu'elles seront ignorées et vice-versa.
EDIT : ça existe là par ex : https://github.com/supersonicclay/csharp-date
Get this extension back !
Use case : I have a db column with 255 chars length. I therefore ensure that my string fits with doing mystring.truncate(255).
Problem : The addition of ellipsis being true by default, the current implementation truncate to 255 AND THEN add the ellipsis, making it 258 characters. The insert in my db fails.
Solution : Taking into account the length of the ellipsis by truncating with (maxLength - sizeof(ellipsis)).
This does not break the api and won't affect negatively existing usage (I would even say would affect positively).
I can take care of the implementation if you agree.
Does this project use any Continuous Integration Tool? If so, is it online? (TravisCI, CircleCI), or offline tool (Jenkins, Hudson).
The implementation in Lucca differs from NExtends.
Need to test NExtends implementation comparer to Lucca, and decide if we can safely remove the Lucca version.
If we want to migrate DateTime.GetQuarterRange( ), we need to first migrate Period, ITimeblock & associated classes.
Sylvain & his team have started such project during the last technical meeting, but I don't see any such branch
This extension is implemented differently in Lucca.
We should take the best implementation, take some tests from Lucca to ensure no breaking change.
Then release a new version of NExtends and uses it in Lucca
NExtends n'a que 2 dépendances :
La première est utilisé pour gérer les attributs de validation et les attributs au-dessus des Enums, donc on doit la garder.
La seconde en revanche n'est plus utilisée que dans des tests, donc on peut la virer.
Je propose de réduire au max le nb de dépendances de NExtends, car plus il a de dépendances, plus les projets qui dépendent de NExtends (Rdd, le monolithe) doivent eux-aussi changer de version de ces dépendances quand NExtends passent sur des versions supérieures.
Par ex cette PR anodine #62 a des répercutions galères sur le monolithe.
Precisely ØøæÆœŒ
This method is Lucca-legacy-specific ! I copied that method inside Lucca project, so we can safely remove it from NExtends
L'extension StringExtensions.Replace(this string originalString, string oldValue, string newValue, StringComparison comparisonType)
est très lente lorsque la chaine à remplacer a un nombre important d'occurrences.
Par exemple :
string stringToReplace = "hello";
string source = String.Join(" blabla ", Enumerable.Range(0, 10000).Select(i => stringToReplace));
var sw = new Stopwatch();
sw.Start();
source.Replace("whatever", "", StringComparison.InvariantCultureIgnoreCase);
sw.ElapsedMilliseconds.Dump(); // 0 occurrence => ~ 1 ms
sw.Restart();
source.Replace(stringToReplace, "", StringComparison.InvariantCultureIgnoreCase);
sw.ElapsedMilliseconds.Dump(); // 10 000 occurrences => ~ 2 700 ms
sw.Restart();
source.Replace(stringToReplace, "");
sw.ElapsedMilliseconds.Dump(); // fonction native avec 10 000 occurrences => ~ 0 ms
If we want to migrate this method from Lucca, we need to handle the way Lucca uses RESX to translate Domain_Generics.HOURS_INITIAL
Some minor changes on RequiredIfAttribute.cs :
Il faudrait reprendre ce FIX de Tim : https://github.com/LuccaSA/ilucca/pull/6396
Dans cette méthode : https://github.com/LuccaSA/NExtends/blob/master/NExtends/Primitives/Strings/String.extensions.cs#L235
Et les TU qui vont avec ;)
Align between Lucca & NExtends, resolving best implementation with UT
In String.extensions.cs, we should separate methods dealing with INSE numbers etc in a separate dedicated place.
Currently, the only way to know everything present in NExtends is to look at the code.
It would be nice to have a nice, automatically generated doc available
In String.extensions.cs, RemoveSpecialCaracters can be optimized.
General all the regex-based methods could be improved
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.