]> git.kaiwu.me - klib.git/log
klib.git
7 years agofixed insert counting err; couting with del
Heng Li [Mon, 18 Jun 2018 02:01:44 +0000 (22:01 -0400)]
fixed insert counting err; couting with del

7 years agokavl_find() gave wrong counts when equal
Heng Li [Thu, 17 May 2018 21:43:47 +0000 (17:43 -0400)]
kavl_find() gave wrong counts when equal

7 years agofixed a bug in kavl_find()
Heng Li [Thu, 17 May 2018 19:07:23 +0000 (15:07 -0400)]
fixed a bug in kavl_find()

8 years agoEigenvalues for dense symmetric matrices
Heng Li [Fri, 11 May 2018 17:03:25 +0000 (13:03 -0400)]
Eigenvalues for dense symmetric matrices

8 years agogeneralize kavl_itr_eq() to kavl_itr_find()
Heng Li [Thu, 3 May 2018 14:47:39 +0000 (10:47 -0400)]
generalize kavl_itr_eq() to kavl_itr_find()

Also documented the iterator functions

8 years agouse more robust comparison in examples
Heng Li [Fri, 20 Apr 2018 12:09:28 +0000 (08:09 -0400)]
use more robust comparison in examples

8 years agofixed a compiler warning
Heng Li [Fri, 20 Apr 2018 03:38:02 +0000 (23:38 -0400)]
fixed a compiler warning

8 years agoalso check balance factor
Heng Li [Sun, 15 Apr 2018 02:58:15 +0000 (22:58 -0400)]
also check balance factor

8 years agoadded a simpler tree deallocator
Heng Li [Sun, 15 Apr 2018 01:51:26 +0000 (21:51 -0400)]
added a simpler tree deallocator

8 years agofaster way to delete the first node
Heng Li [Sat, 14 Apr 2018 23:46:12 +0000 (19:46 -0400)]
faster way to delete the first node

8 years agoadded light documentation on kavl
Heng Li [Sat, 14 Apr 2018 23:31:22 +0000 (19:31 -0400)]
added light documentation on kavl

8 years agoMerge remote-tracking branch 'origin/master'
Heng Li [Sat, 14 Apr 2018 22:37:15 +0000 (18:37 -0400)]
Merge remote-tracking branch 'origin/master'

8 years agoadded kavl.h
Heng Li [Sat, 14 Apr 2018 22:35:48 +0000 (18:35 -0400)]
added kavl.h

Intrusive generic AVL tree in ANSI C

8 years agofind the largest chunk of free memory
Heng Li [Fri, 19 Jan 2018 22:36:02 +0000 (17:36 -0500)]
find the largest chunk of free memory

8 years agoMerge pull request #94 from daviesrob/kstrtok
Heng Li [Thu, 11 Jan 2018 15:15:07 +0000 (10:15 -0500)]
Merge pull request #94 from daviesrob/kstrtok

Fix kstrtok finished flag check, undefined behaviour and sign extension issues

8 years agoFix undefined behaviour and sign extension issues in kstrtok
Rob Davies [Wed, 10 Jan 2018 17:05:57 +0000 (17:05 +0000)]
Fix undefined behaviour and sign extension issues in kstrtok

Prevent read beyond the end of sep if it's an empty string.

Change to internally use unsigned char to avoid unwanted sign
extension on platforms where 'char' is signed.

Fix undefined behaviour where pointers were made to the element
before the start of `str`:
https://www.securecoding.cert.org/confluence/display/c/ARR30-C.+Do+not+form+or+use+out-of-bounds+pointers+or+array+subscripts

8 years agoFixes the finished flag.
Valeriu Ohan [Thu, 4 Jan 2018 13:00:02 +0000 (13:00 +0000)]
Fixes the finished flag.

8 years agoadded Brent's root finding; not tested
Heng Li [Wed, 6 Dec 2017 20:28:11 +0000 (15:28 -0500)]
added Brent's root finding; not tested

8 years agoadded kalloc
Heng Li [Sun, 24 Sep 2017 17:57:49 +0000 (13:57 -0400)]
added kalloc

8 years agoREADME formatting
Heng Li [Fri, 2 Jun 2017 19:30:49 +0000 (15:30 -0400)]
README formatting

9 years agouse long for forpool
Heng Li [Sat, 4 Mar 2017 14:03:57 +0000 (09:03 -0500)]
use long for forpool

9 years agoMerge pull request #79 from pmelsted/master
Heng Li [Sat, 11 Feb 2017 20:31:43 +0000 (15:31 -0500)]
Merge pull request #79 from pmelsted/master

Adds checks for failed reads and gzip files with corrupt crc.

9 years agoAdds checks for failed reads and gzip files with corrupt crc.
Pall Melsted [Thu, 19 Jan 2017 22:56:04 +0000 (22:56 +0000)]
Adds checks for failed reads and gzip files with corrupt crc.

9 years agoforpool working
Heng Li [Fri, 16 Dec 2016 22:44:51 +0000 (17:44 -0500)]
forpool working

9 years agokt_for with a mini thread pool; buggy
Heng Li [Fri, 16 Dec 2016 20:20:24 +0000 (15:20 -0500)]
kt_for with a mini thread pool; buggy

deadlock on mac sometimes

9 years agoadded dequeue
Heng Li [Mon, 22 Aug 2016 12:34:34 +0000 (08:34 -0400)]
added dequeue

9 years agokexpr: evaluate by return type
Heng Li [Tue, 16 Aug 2016 21:08:06 +0000 (17:08 -0400)]
kexpr: evaluate by return type

9 years agoadded a simple header for kthread
Heng Li [Sun, 31 Jul 2016 14:53:24 +0000 (10:53 -0400)]
added a simple header for kthread

9 years agosync kthread with the one in minimap/bwa
Heng Li [Sun, 31 Jul 2016 14:51:35 +0000 (10:51 -0400)]
sync kthread with the one in minimap/bwa

10 years agoMerge branch 'master' of github.com:attractivechaos/klib
Heng Li [Wed, 30 Dec 2015 16:22:07 +0000 (11:22 -0500)]
Merge branch 'master' of github.com:attractivechaos/klib

10 years agodraw a random number from Gaussian N(0,1)
Heng Li [Wed, 30 Dec 2015 16:21:44 +0000 (11:21 -0500)]
draw a random number from Gaussian N(0,1)

10 years agoMerge pull request #62 from innoink/master
Heng Li [Fri, 23 Oct 2015 12:50:39 +0000 (08:50 -0400)]
Merge pull request #62 from innoink/master

fix spelling mistake

10 years agofix spelling mistake
innoink [Fri, 23 Oct 2015 06:00:11 +0000 (14:00 +0800)]
fix spelling mistake

10 years agoadded
Heng Li [Tue, 29 Sep 2015 12:28:48 +0000 (08:28 -0400)]
added

10 years agosimplified the kbtree iter a bit
Heng Li [Thu, 17 Sep 2015 23:43:01 +0000 (19:43 -0400)]
simplified the kbtree iter a bit

10 years agoMerge branch 'master' of github.com:attractivechaos/klib
Heng Li [Thu, 17 Sep 2015 23:24:05 +0000 (19:24 -0400)]
Merge branch 'master' of github.com:attractivechaos/klib

10 years agoadded iterator interface to kbtree
Heng Li [Thu, 17 Sep 2015 23:23:33 +0000 (19:23 -0400)]
added iterator interface to kbtree

and deprecated the old macro interface

10 years agoMerge pull request #53 from jmarshall/kgetline
Heng Li [Thu, 23 Jul 2015 15:18:35 +0000 (11:18 -0400)]
Merge pull request #53 from jmarshall/kgetline

Add kstring kgetline() and ks_release() functions

10 years agoMerge pull request #47 from jmarshall/unused-warnings
Heng Li [Thu, 23 Jul 2015 15:17:31 +0000 (11:17 -0400)]
Merge pull request #47 from jmarshall/unused-warnings

Prevent unused function warnings in khash.h, klist.h

10 years agoMerge pull request #32 from jmarshall/getaddrinfo
Heng Li [Thu, 23 Jul 2015 15:17:01 +0000 (11:17 -0400)]
Merge pull request #32 from jmarshall/getaddrinfo

Don't call freeaddrinfo() when getaddrinfo() fails

10 years agoDon't call freeaddrinfo() when getaddrinfo() fails
John Marshall [Wed, 16 Apr 2014 13:07:03 +0000 (14:07 +0100)]
Don't call freeaddrinfo() when getaddrinfo() fails

POSIX is somewhat unclear here, but doing so segfaults on some
platforms.  Hat tip Kamil Slowikowski @slowkow.

Instead print a more detailed error message using gai_strerror().

10 years agoPrevent unused function warnings in khash.h, klist.h
John Marshall [Tue, 24 Mar 2015 09:37:12 +0000 (09:37 +0000)]
Prevent unused function warnings in khash.h, klist.h

Recent versions of Clang warn about unused static inline functions
in .c files (though they suppress this warning for such definitions
in header files).  Definitions via KHASH_INIT etc are effectively in
the .c file, and it's impractical to make these inline other than
static inline; so add attributes to suppress these warnings.

10 years agoAdd kgetline() to kstring.c/.h
John Marshall [Tue, 9 Jun 2015 02:29:54 +0000 (03:29 +0100)]
Add kgetline() to kstring.c/.h

Similar to BSD's getline() but omits the \n terminator and manages the
memory as a kstring.  Call with "(kgets_func *) fgets" to read from stdio,
or implement an fgets()-style function to read from other streams, e.g.,
a wrapper around gzgets() that reorders its parameters as per fgets().

10 years agoAdd ks_release() to kstring.h
John Marshall [Wed, 12 Mar 2014 14:33:12 +0000 (14:33 +0000)]
Add ks_release() to kstring.h

Using this function is a more explicit way of transferring ownership
than just "foo = str.s"; the latter leaves room for readers to wonder
whether a subsequent "free(str.s)" has been forgotten.

10 years agoMerge pull request #52 from ihh/master
Heng Li [Fri, 26 Jun 2015 19:27:38 +0000 (15:27 -0400)]
Merge pull request #52 from ihh/master

Fixed output bug where leaf branch length is not printed

10 years agoFixed output bug where branch length is not printed on branches to leaf nodes
Ian Holmes [Fri, 26 Jun 2015 18:21:26 +0000 (14:21 -0400)]
Fixed output bug where branch length is not printed on branches to leaf nodes

10 years agofixed a bug and a portability issue
Heng Li [Fri, 22 May 2015 18:35:19 +0000 (14:35 -0400)]
fixed a bug and a portability issue

10 years agodon't stop on undefined functions
Heng Li [Fri, 22 May 2015 18:02:38 +0000 (14:02 -0400)]
don't stop on undefined functions

10 years agoset user-defined functions
Heng Li [Fri, 22 May 2015 14:54:16 +0000 (10:54 -0400)]
set user-defined functions

10 years agocode cleanup
Heng Li [Fri, 22 May 2015 13:53:25 +0000 (09:53 -0400)]
code cleanup

10 years agodon't return a parse error if see undef func
Heng Li [Fri, 22 May 2015 13:42:03 +0000 (09:42 -0400)]
don't return a parse error if see undef func

10 years agoa little bit code cleanup
Heng Li [Fri, 22 May 2015 13:36:05 +0000 (09:36 -0400)]
a little bit code cleanup

10 years agomoved argument checking to ke_parse()
Heng Li [Fri, 22 May 2015 13:12:15 +0000 (09:12 -0400)]
moved argument checking to ke_parse()

10 years agosimplified ke_eval() with operator functions
Heng Li [Fri, 22 May 2015 13:02:38 +0000 (09:02 -0400)]
simplified ke_eval() with operator functions

10 years agouse operator functions
Heng Li [Fri, 22 May 2015 12:50:12 +0000 (08:50 -0400)]
use operator functions

10 years agosupport single-quotation mark and escaping
Heng Li [Fri, 22 May 2015 02:29:24 +0000 (22:29 -0400)]
support single-quotation mark and escaping

10 years agocommand line assignment
Heng Li [Fri, 22 May 2015 02:26:56 +0000 (22:26 -0400)]
command line assignment

10 years agocheck unknown function names
Heng Li [Fri, 22 May 2015 02:18:41 +0000 (22:18 -0400)]
check unknown function names

10 years agoreturn final type
Heng Li [Fri, 22 May 2015 02:12:02 +0000 (22:12 -0400)]
return final type

10 years agosupport assignment
Heng Li [Fri, 22 May 2015 02:05:51 +0000 (22:05 -0400)]
support assignment

10 years agofixed a bug related to functions
Heng Li [Fri, 22 May 2015 01:54:10 +0000 (21:54 -0400)]
fixed a bug related to functions

10 years agoadded a few unary functions
Heng Li [Fri, 22 May 2015 01:50:26 +0000 (21:50 -0400)]
added a few unary functions

10 years agoeval working
Heng Li [Fri, 22 May 2015 01:38:12 +0000 (21:38 -0400)]
eval working

10 years agochanged a variable name
Heng Li [Thu, 21 May 2015 23:38:46 +0000 (19:38 -0400)]
changed a variable name

10 years agoadded ** and //
Heng Li [Thu, 21 May 2015 23:14:51 +0000 (19:14 -0400)]
added ** and //

10 years agosupport ","
Heng Li [Thu, 21 May 2015 23:01:43 +0000 (19:01 -0400)]
support ","

10 years agoparse math expression with Shunting-yard
Heng Li [Thu, 21 May 2015 19:58:14 +0000 (15:58 -0400)]
parse math expression with Shunting-yard

11 years agoa bit more comments
Heng Li [Sun, 11 Jan 2015 21:29:39 +0000 (16:29 -0500)]
a bit more comments

11 years agoallow to change pipeline threads
Heng Li [Sun, 11 Jan 2015 21:27:22 +0000 (16:27 -0500)]
allow to change pipeline threads

11 years agokt_pipeline() example
Heng Li [Sun, 11 Jan 2015 21:24:54 +0000 (16:24 -0500)]
kt_pipeline() example

11 years agoerh... wrong link in the last commit
Heng Li [Mon, 1 Dec 2014 01:07:04 +0000 (20:07 -0500)]
erh... wrong link in the last commit

11 years agoadded a link to the new doc
Heng Li [Mon, 1 Dec 2014 01:04:22 +0000 (20:04 -0500)]
added a link to the new doc

11 years agoadded links to the new tiddlywiki doc
Heng Li [Mon, 1 Dec 2014 00:52:22 +0000 (19:52 -0500)]
added links to the new tiddlywiki doc

11 years agokson_query() -> kson_by_path() for clarity
Heng Li [Sun, 30 Nov 2014 06:15:00 +0000 (01:15 -0500)]
kson_query() -> kson_by_path() for clarity

11 years agosimplified format() due to a later change
Heng Li [Sun, 30 Nov 2014 05:53:37 +0000 (00:53 -0500)]
simplified format() due to a later change

11 years agorename a member var for clarity
Heng Li [Sun, 30 Nov 2014 05:47:00 +0000 (00:47 -0500)]
rename a member var for clarity

11 years agoremoved *error from kson_parse()
Heng Li [Sun, 30 Nov 2014 05:40:26 +0000 (00:40 -0500)]
removed *error from kson_parse()

Few would be interested in this error code

11 years agoremoved kt_spawn(); added kt_pipeline()
Heng Li [Sun, 30 Nov 2014 05:13:29 +0000 (00:13 -0500)]
removed kt_spawn(); added kt_pipeline()

11 years agomissing include
Heng Li [Sun, 30 Nov 2014 03:13:15 +0000 (22:13 -0500)]
missing include

11 years agoget rid of stdint.h for portability
Heng Li [Sun, 30 Nov 2014 01:44:23 +0000 (20:44 -0500)]
get rid of stdint.h for portability

11 years agominor
Heng Li [Sun, 30 Nov 2014 01:37:04 +0000 (20:37 -0500)]
minor

11 years agominor change
Heng Li [Sun, 30 Nov 2014 01:35:28 +0000 (20:35 -0500)]
minor change

11 years agosimplified the struct
Heng Li [Sun, 30 Nov 2014 01:06:53 +0000 (20:06 -0500)]
simplified the struct

11 years agosimplified the struct a little
Heng Li [Sun, 30 Nov 2014 01:00:28 +0000 (20:00 -0500)]
simplified the struct a little

11 years agosimplified API
Heng Li [Sun, 30 Nov 2014 00:54:16 +0000 (19:54 -0500)]
simplified API

11 years agoquery on CMD; more chanages to happen
Heng Li [Sun, 30 Nov 2014 00:40:08 +0000 (19:40 -0500)]
query on CMD; more chanages to happen

11 years agofixed an error in the example (due to prev rev)
Heng Li [Sun, 30 Nov 2014 00:00:53 +0000 (19:00 -0500)]
fixed an error in the example (due to prev rev)

11 years agoa bit code cleaup
Heng Li [Sat, 29 Nov 2014 23:55:36 +0000 (18:55 -0500)]
a bit code cleaup

11 years agoindent output
Heng Li [Sat, 29 Nov 2014 23:54:26 +0000 (18:54 -0500)]
indent output

11 years agominor change
Heng Li [Sat, 29 Nov 2014 23:24:52 +0000 (18:24 -0500)]
minor change

11 years agoadded JSON query
Heng Li [Sat, 29 Nov 2014 23:20:35 +0000 (18:20 -0500)]
added JSON query

11 years agoisblank() -> isspace()
Heng Li [Sat, 29 Nov 2014 18:02:17 +0000 (13:02 -0500)]
isblank() -> isspace()

11 years agono effective changes
Heng Li [Sat, 29 Nov 2014 18:00:19 +0000 (13:00 -0500)]
no effective changes

11 years agosimplified API a bit
Heng Li [Sat, 29 Nov 2014 17:59:10 +0000 (12:59 -0500)]
simplified API a bit

11 years agofixed compilation error in the last commit
Heng Li [Sat, 29 Nov 2014 17:41:26 +0000 (12:41 -0500)]
fixed compilation error in the last commit

11 years agoadded deallocator
Heng Li [Sat, 29 Nov 2014 17:40:39 +0000 (12:40 -0500)]
added deallocator

11 years agoadded API documentation
Heng Li [Sat, 29 Nov 2014 17:37:57 +0000 (12:37 -0500)]
added API documentation

11 years agocode cleanup
Heng Li [Sat, 29 Nov 2014 17:28:04 +0000 (12:28 -0500)]
code cleanup

11 years agoimproved comments a little
Heng Li [Sat, 29 Nov 2014 17:21:42 +0000 (12:21 -0500)]
improved comments a little

11 years agobug for empty []/{}; check extra left brackets
Heng Li [Sat, 29 Nov 2014 17:09:47 +0000 (12:09 -0500)]
bug for empty []/{}; check extra left brackets