1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-03-01 00:35:28 +08:00
Commit Graph

1295 Commits

Author SHA1 Message Date
Cannian e9280b8c25 add Concat method (#204)
* feat(strutil): add Concat method

* feat(strutil): add Concat method
2024-03-25 10:26:37 +08:00
dudaodong bb6f10a1fb rename CONTRIBUTING file 2024-03-17 10:30:24 +08:00
dudaodong 33b4cffe60 rename CONTRIBUTING file 2024-03-17 10:30:07 +08:00
Cannian 2b765b49e0 refactor(set): pop method randomly removes an element and return (#202) 2024-03-17 10:28:25 +08:00
dudaodong 004dbdc32e doc: update doc for RightPadding and LeftPadding 2024-03-12 09:52:02 +08:00
donutloop ab50e8120a Slice: padding (#201)
* LeftPadding adds padding to the left begin of a slice.
* RightPadding adds padding to the right end of a slice.
2024-03-10 21:24:17 +08:00
dudaodong 73c97af7d8 doc: update doc for Break function 2024-03-08 21:39:06 +08:00
donutloop 5e8a065eaa Slice: break (#200)
Splits a slice into two based on a predicate function. It starts appending to the second slice after the first element that matches the predicate. All elements after the first match are included in the second slice, regardless of whether they match the predicate or not.
2024-03-07 14:11:19 +08:00
dudaodong aa74400607 doc: fix doc text error 2024-03-06 16:19:20 +08:00
dudaodong a6eaaef563 doc: add go playground demo 2024-03-06 15:28:55 +08:00
dudaodong 1b31014f81 doc: add go playground demo 2024-03-06 14:52:35 +08:00
dudaodong 036847577d release v2.3.0 v2.3.0 2024-03-05 14:57:16 +08:00
dudaodong d21edd1cde doc: add doc for retry package 2024-03-05 14:38:42 +08:00
dudaodong c58c50327c doc: add doc for ChunkRead and ParallelChunkRead 2024-03-05 11:42:03 +08:00
dudaodong 9bfdc686f8 doc: update contribution_guide file 2024-03-05 10:47:51 +08:00
dudaodong 5ca8f6ef6f doc: update doc 2024-03-05 10:45:40 +08:00
dudaodong a54d4c79a0 doc: update doc for mathutil package 2024-03-04 19:52:49 +08:00
Cannian f7b54986aa feat(mathutil): add DIv, FloorToFloat, FloorToString, CeilToFloat, CeilToString (#199) 2024-03-04 17:40:31 +08:00
dudaodong 92fae4273b doc: update doc for new added functions 2024-03-04 16:42:59 +08:00
dudaodong 0d29f5437a doc: update doc for new added functions 2024-03-04 16:41:54 +08:00
dudaodong e95d7c82cd doc: update doc for function package 2024-03-04 10:19:39 +08:00
donutloop e138043289 Function: AcceptIf (#198)
AcceptIf returns another function of the same signature as the apply function but also includes a bool value to indicate success or failure.
A predicate function that takes an argument of type T and returns a bool.
An apply function that also takes an argument of type T and returns a modified value of the same type.
2024-03-04 10:00:43 +08:00
dudaodong aabfcb7bde doc: update doc for HammingDistance 2024-03-03 21:55:27 +08:00
donutloop 0b5e884371 Strutil: HammingDistance func (#197)
* Strutil: HammingDistance func

The Hamming distance is the number of positions at which the corresponding symbols are different

* Add hamming distance doc
2024-03-03 21:48:34 +08:00
dudaodong 3d1bd08434 doc: update doc for new functions 2024-03-01 22:38:57 +08:00
dudaodong a62ad71791 Merge branch 'rc' into v2 2024-03-01 21:45:08 +08:00
Cannian c02c4f813b refactor(mathutil): round related method support generics (#195) 2024-03-01 16:04:23 +08:00
pigwantacat 235d2f2486 修复MAXIMUM_CAPACITY超过int最大值 (#196)
* refactor:refactor random function

* fix:fix random function

---------

Co-authored-by: zhuhebin <zhuhebin@fengtaisec.com>
2024-03-01 15:52:49 +08:00
dudaodong e9380a3d9f fix: fix unused parameters vet issue 2024-03-01 10:05:28 +08:00
Cannian 81d13c2f1a feat(convertor): add ToBase64 related method (#194) 2024-02-29 19:22:32 +08:00
dudaodong 7290296849 update Contributing Guide 2024-02-29 11:49:34 +08:00
dudaodong 8a8460a592 Merge branch 'rc' into v2 2024-02-29 11:34:53 +08:00
dudaodong 7a98c431d3 Merge branch 'main' of github.com:duke-git/lancet 2024-02-29 11:32:44 +08:00
colorcrow 606d887230 增加ParallelChunkRead方法,分块并发读取超大文本 (#192) 2024-02-29 11:32:10 +08:00
donutloop 473f9c9f3e Iterator: general refactoring and reset method (#193)
Feature

Reset allows for the iteration process over a sequence to be restarted from the beginning.
It enables reusing the iterator for multiple traversals without needing to recreate it.

Refactoring

It is a idiomatic practice to design functions and methods to return concrete struct types.
This approach promotes flexibility and decoupling, allowing the calling code to work with any implementation that satisfies the interface
2024-02-29 11:30:12 +08:00
dudaodong 9ff3d0e79c create rc branch for release candidate 2024-02-29 11:25:20 +08:00
dudaodong 5db1d07d6d Merge branch 'main' into v2 2024-02-28 15:55:59 +08:00
Cannian 6c6d14828a feat(set, doc): add ToSlice,ToSortedSlice method,fix doc (#189) 2024-02-28 15:43:34 +08:00
donutloop 0e1593c67b Slice: Add SetToDefaultIf (#187)
SetToDefaultIf sets elements to their zero value if they match the given predicate.
It retains the positions of the elements in the slice.
It returns slice of T and the count of modified slice items
2024-02-28 11:27:23 +08:00
cannian1 6c7f38d8b3 feat: more readable panic (#183) 2024-02-27 10:38:08 +08:00
donutloop 069812e0ee Hashmap: Add FilterByValue (#184)
The FilterByValue function is a method defined on the HashMap type. It generates a new HashMap
containing only the elements that satisfy a specified condition,
as determined by a predicate function applied to each element's value.

Note: Will add later doc
2024-02-27 10:36:26 +08:00
dudaodong 4a539a23c8 doc: add doc for Xnor and Nand in function package 2024-02-26 10:10:37 +08:00
dudaodong 0b1dab0399 Merge branch 'main' into v2 2024-02-26 10:02:00 +08:00
donutloop 805e2543d0 Add functional predicate NAND (#182)
Add new function, NAND, designed to create a composed predicate representing the logical NAND operation
applied to a list of predicates. The NAND operation is a logical operation
that returns true only if all perdicate result in false otherwise false
2024-02-26 09:58:19 +08:00
dudaodong a3d518da76 remove test_src directory 2024-02-25 20:29:49 +08:00
dudaodong e3e2d8394c Merge branch 'v2' of github.com:duke-git/lancet into v2 2024-02-25 20:25:44 +08:00
yunxuan 0eeaa06055 feat(fileutil): add CopyDir func (#180)
* add fileutil.CopyDir

* remove debug code
2024-02-25 20:25:00 +08:00
donutloop a43bc554ee Add functional predicate XNOR (#181)
Add new function, Xnor, designed to create a composed predicate representing
the logical Exclusive NOR (XNOR) operation applied to a list of predicates.
The XNOR operation is a logical operation that returns true only
if all operands have the same boolean value
2024-02-25 20:24:47 +08:00
dudaodong aebab7c944 refactor: break change, rename constructor of set (NewSet->New, NewSetFromSlice->FromSlice) 2024-02-25 09:32:32 +08:00
dudaodong 665bad4ca3 doc: update doc for IndexOfFunc and LastIndexOfFunc 2024-02-25 09:25:07 +08:00