Commit Graph

2491 Commits

Author SHA1 Message Date
def
28fa1c3b40 Add sorted proc to algorithm module 2015-02-20 04:57:53 +01:00
Andreas Rumpf
43c023c8dd Merge pull request #2164 from oderwat/fix-tohex
Fixing toHex() to not wrap for long lens + Test
2015-02-19 09:12:50 +01:00
def
ecfaab68f1 Make readBytes and writeBytes work with uint8
So far only openarray[int8] worked. Now it's openarray[int8|uint8]. This
should make sense, since uint8 is comfortable to represent a byte
(0-255) and there is already type byte* = uint8 in system.
2015-02-18 21:13:01 +01:00
Hans Raaf
88f3b1d99f Fixing toHex() to not wrap for long lens.
If you specify a len like 32 toHex() will repeat the given value in the
output. Besides that I believe my implementation is easier and seems not
to change how negative numbers are handled. I also handle the case of
wrapping negative number beyond BiggestInt to "do it right".
2015-02-18 18:58:20 +01:00
Andreas Rumpf
358d4b958c Merge pull request #2139 from c-blake/devel
Add mgetOrPut to support just one probe chase for the common
2015-02-18 15:56:23 +01:00
Araq
9fe1aa6996 intsets.empty is wrong 2015-02-18 13:44:00 +01:00
Andreas Rumpf
0b1989e6ca Merge pull request #2155 from def-/warnings
Fix a few more warnings
2015-02-18 13:43:06 +01:00
Andreas Rumpf
3e63ce2833 Merge pull request #2156 from def-/usevfork
Always use 0x40 for POSIX_SPAWN_USEVFORK
2015-02-18 13:41:02 +01:00
def
2647423502 Fix documentations for declared (instead of defined) 2015-02-18 01:55:50 +01:00
def
c62b204960 Always use 0x40 for POSIX_SPAWN_USEVFORK 2015-02-17 02:33:54 +01:00
def
e686ca2523 Fix a few more warnings 2015-02-17 02:22:30 +01:00
Charles Blake
55840d9505 Merge ../Nim into devel 2015-02-16 14:55:08 -05:00
Andreas Rumpf
13c2d9b8e2 Merge pull request #2150 from def-/gc2-compiling
Make gc2 compile again and fix some deprecation warnings
2015-02-16 20:33:25 +01:00
def
b9abeff617 Clean up some more deprecation warnings 2015-02-16 19:13:49 +01:00
def
a5d22a9534 Make gc2 compile again 2015-02-16 19:12:09 +01:00
Charles Blake
629decd170 Add comments explaining odd looking i<0..data[i]. 2015-02-16 07:48:31 -05:00
Charles Blake
0a3e732b9f Just do wide interface of hasKeyOrPut & mgetOrPut.
Extract maybe re-hash/re-search and insert logic into a new template.
Use this new template to do impl templates for all three put forms
(which required renaming a couple 'value' arguments to 'val').
Added OrderedTable and OrderedTableRef versions of both as well.
2015-02-16 06:52:23 -05:00
Charles Blake
614a1f9d5a Add TableRef version of mgetOrPut. 2015-02-16 06:02:31 -05:00
Federico Ceratto
657dca5c3b Fix typos 2015-02-15 16:20:32 +00:00
Federico Ceratto
c95f6f117a Fix typos 2015-02-15 16:06:06 +00:00
Charles Blake
7c1c9a6a9d Add mgetOrPut to support just one probe chase for the common
pattern of either updating or initializing table entries.
2015-02-15 10:03:41 -05:00
Andreas Rumpf
d8c4c57637 Merge pull request #2133 from def-/cleanup
Cleanup
2015-02-15 15:12:39 +01:00
Andreas Rumpf
21fdda8fbc Merge pull request #2115 from oderwat/no-pthread-on-osx
Disable -pthread for compiler/linker on OSX
2015-02-15 15:07:05 +01:00
Andreas Rumpf
dcf2f8b002 Merge pull request #2132 from fowlmouth/patch-2
Patch 2
2015-02-15 15:05:39 +01:00
Andreas Rumpf
3fc100276c Merge pull request #2122 from c-blake/devel
Update collections/tables.nim as with sets.nim
2015-02-15 15:04:04 +01:00
Hans Raaf
a7484ac092 Fixed non exhaustive case by adding else 2015-02-15 04:44:15 +01:00
Billingsly Wetherfordshire
e22ae986f9 Update basic3d.nim
fix rst error
2015-02-14 17:15:30 -06:00
def
512db9aea6 Fix documentation a bit in unicode 2015-02-14 19:57:32 +01:00
Charles Blake
5068a5aa01 assignment -> shallowCopy for efficiency. 2015-02-13 14:10:09 -05:00
Charles Blake
45a2c1b1d1 Merge ../Nim into devel; track ttables.nim delete. 2015-02-13 08:42:41 -05:00
Charles Blake
d129e8f6c6 Update doc comments to mention rightSize. 2015-02-13 08:28:58 -05:00
Hans Raaf
55ab6cc2b3 Disable -pthread for linker on OSX
The -pthread is not needed on Darwin/OS X and the Apple compilers give a
warning about this if you use --threads:on with the Nim compiler.
2015-02-13 01:51:46 +01:00
Araq
6eb8867f1a fixes #2116 2015-02-13 01:40:29 +01:00
Araq
fde16e6c3e fixes os.moveFile on Windows 2015-02-13 01:39:20 +01:00
Andreas Rumpf
f039aad5e0 Merge pull request #2097 from jferg2010/devel
Date/time parsing
2015-02-12 21:54:43 +01:00
Andreas Rumpf
1d65cd277e Merge pull request #2095 from def-/rdstdin-winfix
Fix readPasswordFromStdin for Windows
2015-02-12 16:15:50 +01:00
Andreas Rumpf
2f62cc91a4 Merge pull request #2111 from lyro/fix-2110
fix conditions for int size in 'math.nextPowerOfTwo' #2110
2015-02-12 15:18:55 +01:00
Araq
41385f3aaf made a test green 2015-02-12 14:56:57 +01:00
Araq
10335fd726 fixed minor bugs; cleaned up tests 2015-02-12 14:56:56 +01:00
Frank Fischer
fcfaf2a844 fix conditions for int size in 'math.nextPowerOfTwo' #2110 2015-02-12 12:47:58 +01:00
Charles Blake
49d88cee68 Oops - missed updates to a few later rawGet()s. 2015-02-12 06:44:09 -05:00
Charles Blake
5fbcf93860 Add hcode,rightSize,rawGetKnownHC. Fix inf loop.
Make similar changes to those made in sets.nim, including hcode, rightSize
rawGet/rawGetKnownHC result protocol, nextTry probe sequence to be the cache
friendlier h=h+1 which in turn allows supporting changing deletion to fix the
infinite loop bug with local rehashing which in turn has desirable properties
of graceful table aging when deletes do happen and also making insert-only
usage patterns no longer pay any time/space cost to check deleted status.

Unlike collections.sets, this module has add() for duplicate key inserts and
a 3rd type of table, CountTable.  The first wrinkle is handled by introducing
a rawGetDeep for unconditionally adding entries along collision chains.  This
point of CountTable seems to be space efficiency at 2 items per slot.  These
changes retain that by keeping the val==0 => EMPTY rule and not caching hash
codes.  putImpl is expanded in-place for CountTable since the new putImpl() is
too different. { Depending on table size relative to caches & key expense,
regular Table[A,B] may become faster than CountTable, especially if the basic
count update could be something like inc(mGetOrPut(t, key, 0)). }

Unit tests pass, but in this module those are much more of just a demo than
probing for bugs.  Should exercise/test this a little more before merging.
2015-02-12 05:22:04 -05:00
Andreas Rumpf
4f00ae5a5a Merge pull request #2108 from oderwat/patch-1
Fixing dylib name for OSX
2015-02-12 10:02:53 +01:00
Andreas Rumpf
f7195becac Merge pull request #2053 from reactormonk/message-for-koch-temp
report how to create a compiler stacktrace #1280
2015-02-12 09:40:31 +01:00
Hans Raaf
ceffdebebb Corrected warnings about deprecated names
I got warning about deprecated names here. I also know that other names probably need to change (T/P prefixes) but I am unsure about the exact rules. I may do that later if you like.
2015-02-11 21:38:55 +01:00
Hans Raaf
743ad639d4 Fixing dylib name for OSX
I don't know if the (15|16...) is supposed to work on OSX. I have "libmysqlclient.18.dylib" in my lib directory and get "could not load: libmysqlclient.(15|16|17[18).dylib" on execution. After removing the pattern I can run my little example program and it works as "libmysqlclient.dylib" is a softlink to the current version anyway.
2015-02-11 21:38:55 +01:00
Andreas Rumpf
a508055687 Merge pull request #2078 from c-blake/devel
Add hcode.  Re-factor rawGet.  Fix infinite loop.
2015-02-11 17:44:13 +01:00
Jeff
7251fbd76e Date/time parsing - removed comments from assert 2015-02-11 15:52:15 +09:00
Jeff
3643068527 Date/time parsing with changes suggested by Araq 2015-02-11 15:42:33 +09:00
Araq
eec18896b7 cleaned up GC tests; fixes object variant re-assign bug 2015-02-10 20:19:47 +01:00