]> git.kaiwu.me - klib.git/log
klib.git
12 years agofixed a bug in seek
Heng Li [Sun, 24 Nov 2013 19:59:37 +0000 (14:59 -0500)]
fixed a bug in seek

12 years agoadded a note about S3
Heng Li [Thu, 21 Nov 2013 18:13:57 +0000 (13:13 -0500)]
added a note about S3

12 years agoadded HMAC-SHA1 to drop the openssl dependency
Heng Li [Thu, 21 Nov 2013 17:51:44 +0000 (12:51 -0500)]
added HMAC-SHA1 to drop the openssl dependency

12 years agoallow to feed change key/secret/id-file
Heng Li [Thu, 21 Nov 2013 05:22:33 +0000 (00:22 -0500)]
allow to feed change key/secret/id-file

12 years agosupport the s3:// protocol
Heng Li [Thu, 21 Nov 2013 05:13:05 +0000 (00:13 -0500)]
support the s3:// protocol

12 years agohalve the buffer size
Heng Li [Wed, 20 Nov 2013 19:32:49 +0000 (14:32 -0500)]
halve the buffer size

12 years agouse fixed-length buffer with pause()
Heng Li [Wed, 20 Nov 2013 19:18:19 +0000 (14:18 -0500)]
use fixed-length buffer with pause()

12 years agoignore signal
Heng Li [Wed, 20 Nov 2013 16:23:02 +0000 (11:23 -0500)]
ignore signal

12 years agoneed to grow buffer
Heng Li [Tue, 19 Nov 2013 03:07:40 +0000 (22:07 -0500)]
need to grow buffer

One multi_perform() frequently invokes multiple write_cb(). We have to use a
dynamic buffer. Hmm.. I really do not like the curl APIs, although I understand
why they are designed this way.

12 years agowrong dopen() interface
Heng Li [Tue, 19 Nov 2013 02:35:23 +0000 (21:35 -0500)]
wrong dopen() interface

12 years agoforgot ";"
Heng Li [Tue, 19 Nov 2013 02:04:58 +0000 (21:04 -0500)]
forgot ";"

12 years agoforgot to alias kurl_t to knetFile
Heng Li [Tue, 19 Nov 2013 02:04:40 +0000 (21:04 -0500)]
forgot to alias kurl_t to knetFile

12 years agoemulating knetfile APIs
Heng Li [Tue, 19 Nov 2013 02:03:25 +0000 (21:03 -0500)]
emulating knetfile APIs

12 years agoadded dopen()/buflen() and optional options
Heng Li [Tue, 19 Nov 2013 01:42:28 +0000 (20:42 -0500)]
added dopen()/buflen() and optional options

12 years agouse larger buffer for remote files
Heng Li [Mon, 18 Nov 2013 20:39:12 +0000 (15:39 -0500)]
use larger buffer for remote files

12 years agoFixed slow sftp/scp connection
Heng Li [Mon, 18 Nov 2013 20:29:18 +0000 (15:29 -0500)]
Fixed slow sftp/scp connection

In curl/docs/examples/fopen.c, the developer didn't check maxfd set by
curl_multi_fdset() and supposed that calling select(0,...) is effectively
equivalent to sleep. While the comment is correct, timeout estimated by
curl_multi_fdset() is frequently too large - in my case 10 seconds. We seldom
need to wait that long.

In curl_multi_fdset.3, the cURL developers recommended to wait at least 100ms
if maxfd is set to 1. This is what I am doing in the revised code. It does
little harm.

12 years agobetter CLI
Heng Li [Mon, 18 Nov 2013 17:18:34 +0000 (12:18 -0500)]
better CLI

sftp connection is really slow. Don't know why.

12 years agobetter interface and documentations
Heng Li [Mon, 18 Nov 2013 16:48:26 +0000 (11:48 -0500)]
better interface and documentations

12 years agoknetfile-like interface to CURL
Heng Li [Mon, 18 Nov 2013 15:55:21 +0000 (10:55 -0500)]
knetfile-like interface to CURL

12 years agoforgot the header file
Heng Li [Sat, 2 Nov 2013 12:26:41 +0000 (08:26 -0400)]
forgot the header file

For kt_for() it is actually not needed.

12 years agoadded a more flexible scheduler; not tested
Heng Li [Fri, 11 Oct 2013 17:17:26 +0000 (13:17 -0400)]
added a more flexible scheduler; not tested

not thoroughly

12 years agochange the argument ordering
Heng Li [Fri, 11 Oct 2013 13:34:42 +0000 (09:34 -0400)]
change the argument ordering

12 years agoadded the test program for kthread
Heng Li [Fri, 11 Oct 2013 03:28:17 +0000 (23:28 -0400)]
added the test program for kthread

12 years agoreduced a redundant variable; fix for wrong tid
Heng Li [Thu, 10 Oct 2013 20:06:02 +0000 (16:06 -0400)]
reduced a redundant variable; fix for wrong tid

12 years agowait-free heap-free implementation of kt_for()
Heng Li [Thu, 10 Oct 2013 16:39:12 +0000 (12:39 -0400)]
wait-free heap-free implementation of kt_for()

and also much simpler

12 years agosimplified the kt_for() API
Heng Li [Thu, 10 Oct 2013 14:37:14 +0000 (10:37 -0400)]
simplified the kt_for() API

 * the local array can fit into the global data
 * sometimes caller needs to know thread id to maintain buffer

12 years agorevert to kt_for()
Heng Li [Thu, 10 Oct 2013 04:20:08 +0000 (00:20 -0400)]
revert to kt_for()

the new version is buggy and even if I could fix it, I would not feel
confident. Perhaps I will come back later when I am more competent.

12 years agotest C++ spawn-final
Heng Li [Thu, 10 Oct 2013 04:18:59 +0000 (00:18 -0400)]
test C++

12 years agomore versatile APIs
Heng Li [Thu, 10 Oct 2013 03:53:56 +0000 (23:53 -0400)]
more versatile APIs

12 years agopass item index to function calls
Heng Li [Thu, 10 Oct 2013 03:52:13 +0000 (23:52 -0400)]
pass item index to function calls

kt_for() to be replaced by more complex but more versatile APIs

12 years agodon't need this now, but maybe in future
Heng Li [Wed, 9 Oct 2013 18:26:17 +0000 (14:26 -0400)]
don't need this now, but maybe in future

12 years agofixed a dead loop when n_threads==1
Heng Li [Wed, 9 Oct 2013 16:51:34 +0000 (12:51 -0400)]
fixed a dead loop when n_threads==1

12 years agobugfix: wrong integer type
Heng Li [Wed, 9 Oct 2013 15:55:39 +0000 (11:55 -0400)]
bugfix: wrong integer type

but it does not really matter

12 years agono effective changes
Heng Li [Wed, 9 Oct 2013 15:50:27 +0000 (11:50 -0400)]
no effective changes

12 years agodocumentation; better var names
Heng Li [Wed, 9 Oct 2013 15:47:29 +0000 (11:47 -0400)]
documentation; better var names

12 years agolet the main thread help the unfinished workers
Heng Li [Wed, 9 Oct 2013 15:26:20 +0000 (11:26 -0400)]
let the main thread help the unfinished workers

12 years agomore comments
Heng Li [Wed, 9 Oct 2013 15:01:28 +0000 (11:01 -0400)]
more comments

12 years agoforgot to remove debugging code
Heng Li [Wed, 9 Oct 2013 03:08:18 +0000 (23:08 -0400)]
forgot to remove debugging code

which causes bugs

12 years agofixed a typo
Heng Li [Wed, 9 Oct 2013 03:01:44 +0000 (23:01 -0400)]
fixed a typo

12 years agoMerge branch 'master' of github.com:attractivechaos/klib
Heng Li [Wed, 9 Oct 2013 02:52:48 +0000 (22:52 -0400)]
Merge branch 'master' of github.com:attractivechaos/klib

12 years agofor C++ compatibility
Heng Li [Wed, 9 Oct 2013 02:45:29 +0000 (22:45 -0400)]
for C++ compatibility

12 years agouse test-and-set for spin lock
Heng Li [Wed, 9 Oct 2013 00:54:22 +0000 (20:54 -0400)]
use test-and-set for spin lock

12 years agoworking, but locking is slow
Heng Li [Wed, 9 Oct 2013 00:45:40 +0000 (20:45 -0400)]
working, but locking is slow

12 years agoremove
Heng Li [Tue, 8 Oct 2013 20:55:28 +0000 (16:55 -0400)]
remove

12 years agoparallelize simple "for" loops
Heng Li [Tue, 8 Oct 2013 20:50:21 +0000 (16:50 -0400)]
parallelize simple "for" loops

12 years agoparallelize simple "for" loops
Heng Li [Tue, 8 Oct 2013 20:50:21 +0000 (16:50 -0400)]
parallelize simple "for" loops

12 years agoremoved incorrect comments
Heng Li [Wed, 24 Jul 2013 15:19:38 +0000 (11:19 -0400)]
removed incorrect comments

12 years agorevert a change to ks_resize()
Heng Li [Wed, 24 Jul 2013 15:12:19 +0000 (11:12 -0400)]
revert a change to ks_resize()

due to a mistaken merge

12 years agoMerge pull request #21 from jmarshall/kstring
Heng Li [Wed, 24 Jul 2013 14:42:23 +0000 (07:42 -0700)]
Merge pull request #21 from jmarshall/kstring

Make ks_resize(&kstr,kstr.l+1) useful for ensuring the string is allocated and NUL-terminated

12 years agoAdd kstring_t init/destroy documentation
John Marshall [Wed, 24 Jul 2013 13:30:57 +0000 (14:30 +0100)]
Add kstring_t init/destroy documentation

Ideally these could be provided as ks_init()/ks_destroy(),
but those names are already in use with kstream_t.

12 years agoOnly canonicalise if there is room, and add docs
John Marshall [Wed, 24 Jul 2013 13:08:25 +0000 (14:08 +0100)]
Only canonicalise if there is room, and add docs

We could increment SIZE to ensure there would be room, but that would
disadvantage people using kstrings for binary data in power-of-2-sized
blocks.  Instead document that SIZE=KS.l+1 will ensure NUL-termination.

This fixes a bug in the previous version when the l<m invariant does not
hold (kputc_()/etc and manual manipulation only maintain the weaker l<=m);
hattip Rob Davies.

12 years agoks_resize() canonicalises the stored string
John Marshall [Tue, 23 Jul 2013 15:16:19 +0000 (16:16 +0100)]
ks_resize() canonicalises the stored string

It ensures the string is NUL-terminated, especially in the case that
ks_resize(&kstr,1) has been used on a newly-created kstring_t to ensure
that kstr.s is not NULL.

12 years agoMerge pull request #20 from jmarshall/kputl
Heng Li [Tue, 23 Jul 2013 11:50:21 +0000 (04:50 -0700)]
Merge pull request #20 from jmarshall/kputl

Bug fix for kputl(), and kputw()/kputl() tests

12 years agoFix kputl(LONG_MIN) bug
John Marshall [Tue, 23 Jul 2013 10:56:15 +0000 (11:56 +0100)]
Fix kputl(LONG_MIN) bug

Use an explicitly unsigned long, and do any negation as that type.

Make similar changes to kputw(), as the code is clearer.

12 years agoAdd kputw() and kputl() tests
John Marshall [Mon, 22 Jul 2013 15:07:45 +0000 (16:07 +0100)]
Add kputw() and kputl() tests

12 years agoMerge pull request #19 from jkbonfield/master
Heng Li [Fri, 19 Jul 2013 17:58:43 +0000 (10:58 -0700)]
Merge pull request #19 from jkbonfield/master

Error checking + updates from htslib

12 years agoMerged with attractivechaos/klib:
James Bonfield [Wed, 17 Jul 2013 16:51:13 +0000 (17:51 +0100)]
Merged with attractivechaos/klib:
- add upstream kvsprintf and rework ksprintf
- add upstream printf attribute checks
- use our kputw (has MIN_INT bug fix)
- keep our extra functions (kputc_, kputsn_, kputl)

Added ks_str and ks_len functions for tidier manipulation of
internals.

Added error checking to all functions that allocate memory and could
potentially fail; ie return EOF or negative values as per stdio
equivalents.

12 years agoMerge pull request #18 from sciascid/master
Attractive Chaos [Mon, 15 Jul 2013 14:36:39 +0000 (07:36 -0700)]
Merge pull request #18 from sciascid/master

Document -1 extra return code in kh_put().

12 years agoDocument -1 extra return code in kh_put().
Daniele Sciascia [Sat, 13 Jul 2013 19:22:53 +0000 (21:22 +0200)]
Document -1 extra return code in kh_put().

13 years agoMerge pull request #15 from yorhel/master
Attractive Chaos [Wed, 8 May 2013 15:27:26 +0000 (08:27 -0700)]
Merge pull request #15 from yorhel/master

kstring printf improvements

13 years agokstring: Add printf format attribute to kvsprintf() and ksprintf()
Yorhel [Tue, 7 May 2013 10:03:48 +0000 (12:03 +0200)]
kstring: Add printf format attribute to kvsprintf() and ksprintf()

This allows compile-time detection of format-string related bugs.
Although the macros only check for the GCC version, clang (and perhaps
other compilers too) have these macros defined and can recognize
the formatting attributes as well.

13 years agokstring: Add kvsprintf()
Yorhel [Tue, 7 May 2013 09:56:49 +0000 (11:56 +0200)]
kstring: Add kvsprintf()

13 years agokhash-0.2.8: use quadratic probing
Heng Li [Thu, 2 May 2013 21:34:11 +0000 (17:34 -0400)]
khash-0.2.8: use quadratic probing

13 years agochange hash set to hash map
Heng Li [Thu, 2 May 2013 20:25:50 +0000 (16:25 -0400)]
change hash set to hash map

13 years agoMerge branch 'master' of github.com:attractivechaos/klib
Heng Li [Thu, 2 May 2013 19:51:45 +0000 (15:51 -0400)]
Merge branch 'master' of github.com:attractivechaos/klib

13 years agotest performance given packed struct
Heng Li [Thu, 2 May 2013 19:51:14 +0000 (15:51 -0400)]
test performance given packed struct

13 years agoMerge pull request #14 from zjf/patch-1
Attractive Chaos [Mon, 1 Apr 2013 14:44:14 +0000 (07:44 -0700)]
Merge pull request #14 from zjf/patch-1

typo correction

13 years agotypo correction
Jianfeng Zhu [Mon, 1 Apr 2013 14:41:48 +0000 (22:41 +0800)]
typo correction

13 years agoMerge branch 'master' of github.com:attractivechaos/klib
Heng Li [Thu, 21 Feb 2013 01:14:35 +0000 (20:14 -0500)]
Merge branch 'master' of github.com:attractivechaos/klib

13 years agobugfix: point address changes
Heng Li [Thu, 21 Feb 2013 01:14:04 +0000 (20:14 -0500)]
bugfix: point address changes

13 years agoMerge pull request #12 from leecbaker/master
Attractive Chaos [Sat, 16 Feb 2013 13:30:16 +0000 (05:30 -0800)]
Merge pull request #12 from leecbaker/master

Minor spelling fixes

13 years agoSpelling corrections
Lee Baker [Wed, 13 Feb 2013 21:07:00 +0000 (15:07 -0600)]
Spelling corrections

13 years agobugfix: 2nd best score not set
Heng Li [Tue, 12 Feb 2013 22:37:14 +0000 (17:37 -0500)]
bugfix: 2nd best score not set

because I was comparing (uint32_t)-1 with a positive integer...

13 years agoMerge branch 'master' of github.com:attractivechaos/klib
Heng Li [Tue, 12 Feb 2013 21:21:12 +0000 (16:21 -0500)]
Merge branch 'master' of github.com:attractivechaos/klib

13 years agoadded NW and SW-extension; backported from bwa
Heng Li [Tue, 12 Feb 2013 21:20:36 +0000 (16:20 -0500)]
added NW and SW-extension; backported from bwa

13 years agoMerge pull request #11 from leecbaker/master
Attractive Chaos [Fri, 1 Feb 2013 21:11:55 +0000 (13:11 -0800)]
Merge pull request #11 from leecbaker/master

Minor spelling and grammar corrections in the readme

13 years agoSpelling / grammar corrections in the README.
Lee Baker [Fri, 1 Feb 2013 21:08:49 +0000 (15:08 -0600)]
Spelling / grammar corrections in the README.

13 years agominor gramartical improvement
Heng Li [Mon, 28 Jan 2013 02:20:19 +0000 (21:20 -0500)]
minor gramartical improvement

13 years agofixed typo
Heng Li [Mon, 28 Jan 2013 02:17:37 +0000 (21:17 -0500)]
fixed typo

13 years agoExplain the methodology
Heng Li [Mon, 28 Jan 2013 02:15:54 +0000 (21:15 -0500)]
Explain the methodology

13 years agowrong markdown syntax...
Heng Li [Mon, 28 Jan 2013 00:47:23 +0000 (19:47 -0500)]
wrong markdown syntax...

13 years agoUpdated documentation
Heng Li [Sun, 27 Jan 2013 02:08:19 +0000 (21:08 -0500)]
Updated documentation

13 years agoTwo bugs reported by istreeter and wanghc78
Heng Li [Sat, 26 Jan 2013 23:09:06 +0000 (18:09 -0500)]
Two bugs reported by istreeter and wanghc78

13 years agoMerge pull request #6 from johnm/master
Attractive Chaos [Sat, 26 Jan 2013 23:03:23 +0000 (15:03 -0800)]
Merge pull request #6 from johnm/master

Update kmin_test and add .gitignore

13 years agocomputed Kolmogorov-Smirnov's D
Heng Li [Thu, 3 Jan 2013 19:03:50 +0000 (14:03 -0500)]
computed Kolmogorov-Smirnov's D

13 years agoprint tree in the Newick format
Heng Li [Wed, 19 Dec 2012 01:18:20 +0000 (20:18 -0500)]
print tree in the Newick format

13 years agoMerge pull request #7 from arrbee/libgit2-khash-extensions
Heng Li [Wed, 5 Sep 2012 16:15:28 +0000 (09:15 -0700)]
Merge pull request #7 from arrbee/libgit2-khash-extensions

Libgit2 khash extensions

13 years agoAdd khash foreach macros
Russell Belfer [Fri, 31 Aug 2012 23:14:35 +0000 (16:14 -0700)]
Add khash foreach macros

This adds two convenient macros for iterating over all the keys
or all the values in a khash.

13 years agoAdd type casts to avoid warnings
Russell Belfer [Fri, 31 Aug 2012 23:13:18 +0000 (16:13 -0700)]
Add type casts to avoid warnings

On some build platforms, the assignments in the hash string fn
were generating warning messages.  This clears those up.

13 years agoAdd khash wrapper around inline
Russell Belfer [Fri, 31 Aug 2012 23:10:12 +0000 (16:10 -0700)]
Add khash wrapper around inline

As with allocation functions, when embedding khash inside another
library, the use of the non-portable "inline" keyword can be tricky.
Instead of adding a #define of inline, this adds "kh_inline" which
can be defined as needed inside khash with better isolation.

13 years agoAdd allocation wrappers and error checking
Russell Belfer [Fri, 31 Aug 2012 23:06:32 +0000 (16:06 -0700)]
Add allocation wrappers and error checking

When embedding khash in another project, it is convenient to be
able to replace the use of malloc/calloc/free with alternatives.
This wraps those calls with kmalloc/kcalloc/kfree, etc. macros
that can be easily redefined by the khash user to override the
allocators.

Additionally, the return value from allocations was not being
checked.  This adds a check whenever an allocation is performed
and a return code of -1 to indicate an allocation failure.

13 years agoReorganize khash decl macros to separate typedef
Russell Belfer [Fri, 31 Aug 2012 23:01:27 +0000 (16:01 -0700)]
Reorganize khash decl macros to separate typedef

This separates the khash declaration macros into three pieces: one
to declare the type, one for the function prototypes, and one for
the function declarations.  This makes it easier to instantiate a
khash type one time and have a header with just the typedef and
prototypes.

The old macros are redefined in terms of the new ones.

13 years agoAdd basic .gitignore file.
John D. Mitchell [Fri, 31 Aug 2012 22:36:04 +0000 (15:36 -0700)]
Add basic .gitignore file.

13 years agoUpdate kmin_test to use kmath merger.
John D. Mitchell [Fri, 31 Aug 2012 22:34:21 +0000 (15:34 -0700)]
Update kmin_test to use kmath merger.

13 years agoRemoved kfunc, kmin and krand
Heng Li [Mon, 30 Jul 2012 16:13:42 +0000 (12:13 -0400)]
Removed kfunc, kmin and krand

Each of these three libraries consists of a couple of hundred lines of code. I
think it does not harm too much if I put them together. I do not like too many
files...

13 years agomerge kmin.*, kfunc.c and krand.* to kmath.*
Heng Li [Tue, 17 Jul 2012 15:23:36 +0000 (11:23 -0400)]
merge kmin.*, kfunc.c and krand.* to kmath.*

I do not like too many files...

13 years agoadded another radix_sort from gorset/radix
Heng Li [Sun, 10 Jun 2012 22:45:38 +0000 (18:45 -0400)]
added another radix_sort from gorset/radix

13 years agohopefully the final version
Heng Li [Fri, 8 Jun 2012 23:30:23 +0000 (19:30 -0400)]
hopefully the final version

13 years agoimproved my implementation of radix sort
Heng Li [Fri, 8 Jun 2012 23:00:25 +0000 (19:00 -0400)]
improved my implementation of radix sort

13 years agoa new radix sort implementation
Heng Li [Fri, 8 Jun 2012 20:06:12 +0000 (16:06 -0400)]
a new radix sort implementation

The new one is adapted from Victor J. Duvanenko's implementation. It is faster
on random arrays, but slower on sorted arrays.