Commit Graph

2457 Commits

Author SHA1 Message Date
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
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
Araq
683b82a2ec fixes #2070 2015-02-10 20:19:44 +01:00
Dominik Picheta
03019849fc Async await try statement fixes. 2015-02-09 23:00:07 +00:00
Jeff
5424ab3d7e Date/time parsing with minor changes requested by Dom96 2015-02-09 21:46:18 +09:00
Jeff
13c5ce820e Date/time parsing 2015-02-09 20:58:36 +09:00
Varriount
af23312f79 Merge pull request #2059 from def-/getch
Getch
2015-02-09 02:37:36 -05:00
def
d6d152e451 Add a new line after readPasswordFromStdin, add result 2015-02-09 08:06:56 +01:00
def
18fb3a391c Fix readPasswordFromStdin for Windows 2015-02-08 22:53:49 +01:00
Araq
008b0f19bb 'nimsuggest' compiles again 2015-02-08 15:47:55 +01:00
Araq
ada0f14711 fixes #2073 2015-02-08 14:15:02 +01:00
Araq
f7f87a7709 merged #2083 manually 2015-02-08 13:38:04 +01:00
Charles Blake
1f3ce26421 Address Andreas' complaint about code duplication. 2015-02-07 13:13:03 -05:00
Charles Blake
11e7c4960e Merge /home/cb/pkg/nim/Nim into devel
pull from master
2015-02-07 13:11:27 -05:00
Andreas Rumpf
b25346719d Merge pull request #1869 from def-/json-stuff
Json stuff
2015-02-07 18:34:35 +01:00
Andreas Rumpf
28af09a446 Merge pull request #2062 from flaviut/expose-exception-parent
Expose exception parent
2015-02-07 18:21:13 +01:00
Andreas Rumpf
5f2382d093 Merge pull request #2060 from def-/rdstdin-pass
Rdstdin pass
2015-02-07 18:20:39 +01:00
Andreas Rumpf
31074e0015 Merge pull request #2058 from def-/nimrod-cfgs
Rename *.nimrod.cfg to *.nim.cfg
2015-02-07 18:11:00 +01:00
Charles Blake
42f8f1cd1f Fix unnecessarily slow set building from openArray.
The estimation of the initialSize as simply array len + 10 was too small for
for all but the smallest sets.  It would not elide/skip one final enlarge().
That last one is actually always the most expensive enlarge().  Indeed, in a
series where one to start from tiny and build up the table..that last one is
about 50% of all the enlarging time in general.  So, this simple and reasonable
optimization (compared to just starting at 64) was only helping about half as
much as it could.

Introduce a rightSize() proc to be the inverse to mustRehash().  Export it
to clients since pre-sizing is externally useful in set construction and the
current mustRehash rules are opaque and beyond the control of clients.

Also add test module logic to check that rightSize() and mustRehash() are
inverses in the appropriate sense..not really in a block/assertion throwing
unit test since this is a peformance nice-to-have issue rather than about
basic correctness.  (Also, fix a too vs. two typo in doc comment.)
2015-02-07 09:37:17 -05:00
Charles Blake
8e685585a6 Merge /home/cb/pkg/nim/Nim into devel 2015-02-07 09:32:27 -05:00
Araq
0b5c42f405 configuration system supports %= to access environment variables 2015-02-07 12:55:23 +01:00
Araq
74c6c8c903 compiler distinguishes between 2 different 'var' types for C++ interop; code cleanups 2015-02-07 10:48:07 +01:00
Araq
e84834db79 lots of C++ codegen improvements 2015-02-07 10:48:07 +01:00
Fabio Cevasco
99b14c8d8d newRollingFileLogger - fmtStr is always set to defaultFmtStr 2015-02-06 22:40:21 +01:00
Charles Blake
65ce08f38c Add hcode. Re-factor rawGet. Fix infinite loop.
Replace state enum with a cached hash code which has the same memory overhead
and locality as the enum, but can really speed things up with non-integer-like
keys (keys for which either hash() or == take more than couple cycles, or where
the key data is "indirect" and might incur another cache miss).  To function as
both empty/filled state and a hash code cache, it only needs to be ensured that
hash codes are non-zero for any real key.  That is done at the one place in the
whole file hash() is called.  Keep convention clear via isFilled() & isEmpty().
An isDeleted state will no longer be necessary as per below excl/inf loop fix.

Since some use sites know hc and some do not, re-factor rawGet into two forms -
one with known hash code and one with an unknown HC that returns it. Both forms
still return <0 on missing, but returns the much more informative "-1 - index".
That return can be quickly inverted by -1 - result to recover the index where
insert should happen, provided no modifications are made to the table in the
meantime.  This protocol retains the prior <0 interface and also makes it easy
to avoid unnecessary duplicate search work in procs like containsOrInclImpl
(which formerly searched in the initial get and AGAIN in rawInsert).  Strip the
searching part out of rawInsert to "make it even more raw".  swap(s.data, n) a
bit earlier so rawGet and rawGetKnownHC can have similar parameter lists and
integrate well with rawInsert/code sharing between Set and OrderedSet impls.

This PR also fixes infinite looping upon too many deletes. [ The deleted state
(aka "tombstone") approach is vulnerable to the table filling up with deleted
items which forces giant scans for missing keys which could be anywhere.  In
the version prior to this PR, table wraparound wasn't even detected yielding
infinite loops. ] This PR changes excl() from marking slots as deleted to Knuth
algo 6.4R, "local/incremental moveback rehashing" - adapted from Knuth's h->h-1
to the cache-friendlier h->h+1 probe sequence and adapted from "gotos" to a new
doWhile template.  This method restores the table to a state that would have
resulted from pure inserts (in some order).  Update nextTry accordingly.  Since
linear probing can degrade a little faster, 50% rather than 66% may be a better
default growth threshold, but users should be able to adjust threshold anyway.

Old unit tests all pass.  More extensive testing in this module is probably
warranted before taking similar enhancements over to collections.tables.
2015-02-06 09:24:20 -05:00
Araq
c795a469bc fixes #2011 2015-02-05 12:23:26 +01:00
def
416456cefe Try to fix unittest for JS backend, still not working 2015-02-04 21:44:25 +01:00
def
f3922bc4e5 Fix documentation and toJson signature 2015-02-04 19:27:56 +01:00
def
5b26c1360b Rename termios template CCEQ to cceq 2015-02-04 19:18:09 +01:00
Andreas Rumpf
08ee62a783 Merge pull request #2049 from def-/permutations
Add nextPermutation and prevPermutation
2015-02-04 17:12:35 +01:00
def
8640efcd40 Document terminal.getch 2015-02-04 14:10:58 +01:00
def
8f18c936c3 Change termios proc capitalization 2015-02-04 11:25:58 +01:00
def
4712c69512 Fix typo 2015-02-04 11:18:24 +01:00
Andreas Rumpf
f0cdb49c3b Merge pull request #2027 from dumndummer/patch-1
Update sequtils.nim
2015-02-04 10:38:50 +01:00
Flaviu Tamas
c3ca9bf79e Change formatting according to style guide 2015-02-03 21:22:28 -05:00
Flaviu Tamas
769652ac90 Expose exception parent
This can be safely exposed because a proc accessor can be created if the
representation changes.
2015-02-03 21:21:32 -05:00