| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
Darwin has long deprecated the wait union, but their macros still assume
it unless you define _POSIX_C_SOURCE. This trips up C++ compilers.
This commit duplicates the behavior of WEXITSTATUS when _POSIX_C_SOURCE
is defined.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Resolve things raised in https://github.com/nim-lang/Nim/issues/10081 ?
CDF is a standard ident in all things related to random numbers/sampling,
and full words "cumulativeDistributionFunction" would be silly long, in
this case, IMO. We use lowercase `cdf` to make it not look like a type,
remove all looping from `sample` letting callers do it. Besides just
side-stepping any `sampleSize` name choice, callers may want to filter
out samples anyway which this makes slightly simpler.
Also add two variants of `cumsum`, value return and in-place update
distinguished by the var-ness of the first argument. Add tests for
`int` and `float` for both `cumsum` and the new `sample`. (The sample
tests exercise the value return mode of `cumsum`.)
Functionality pre-this-PR `sample(a, w)` is now the almost as simple
`for i in 0..<n: sample(a, w.cumsum)`, but this new code factoring is
almost surely better. The statistical tests pass, as before.
* Address Araq comment in https://github.com/nim-lang/Nim/pull/10084
We can always add in some `var` version later if desired to save
memory, but this change now at least firms up the `sample` interface.
* Rename `cumsum` -> `cumsummed` to honor NEP1 style. Re-instate `cumsum` as
the in-place transformation. Test both in `tests/stdlib/tmath.nim` and use
`cumsummed` in the example code for sample since that's a simpler example.
* Fix requests from https://github.com/nim-lang/Nim/pull/10084 :
example in lib/pure/math.nim and comment whitespace in lib/pure/random.nim
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(#10072)
* Add the ability to sample elements from an openArray according to a parallel
array of weights/unnormalized probabilities (any sort of histogram, basically).
Also add a non-thread safe version for convenience.
* Address Araq comments on https://github.com/nim-lang/Nim/pull/10072
* import at top of file and space after '#'.
* Put in a check for non-zero total weight.
* Clarify constraint on `w`.
* Rename `rand(openArray[T])` to `sample(openArray[T])` to `sample`, deprecating
old name and name new (openArray[T], openArray[U]) variants `sample`.
* Rename caller-provided state version of rand(openArray[T]) and also clean
up doc comments.
* Add test for new non-uniform array sampler. 3 sd bound makes it 99% likely
that it will still pass in the future if the random number generator changes.
We cannot both have a tight bound to check distribution *and* loose check to
ensure resilience to RNG changes. (We cannot *guarantee* resilience, anyway.
There's always a small chance any test hits a legitimate random fluctuation.)
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
* [os] fix #10017 regression
* [os] fix #10025 regression
|
| |
|
| |
|
|
|
|
| |
compiler/pathutils.nim; added os.relativePath
|
|
|
|
| |
Fixes #9243
|
| |
|
|\
| |
| | |
add SinglyLinkedList.append procs
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
|\ \
| |/
|/| |
Add `relative` parameter to walkDirRec
|
| | |
|
| |
| |
| |
| |
| |
| | |
* Add workingDir parameter to execProcess
* Fix tests/stdlib/tosproc.nim compile error
* Suppress output from tosproc.nim
|
| |
| |
| | |
Added cgi.readData. Add test for cgi module.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
|/ |
|
| |
|
| |
|
|
|
|
|
|
| |
* fix wrong utcoffset sign for formats z and zz
* add tests for the timezone offset formats
|
| |
|
|
|
|
|
| |
* change generic `tissues` name to more specific
* change `tvarious` to more specific names
|
|
|
| |
Fixes #6154
|
|
|
|
|
|
|
|
| |
* Remove install.txt and readme.txt
* Refactor tests that use readme.txt
* Tests open own source code
|
|
|
|
|
|
|
|
| |
* strscans: fix typo
* strscans: fix #9240
* strscans: add tests
|
|
|
| |
Also adds a `treeRepr` renderer for the SQL nodes.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
* fix #9394 by replacing `fmt` with normal string append
Until issue #7632 is fixed, use string append.
* use `strutils.%` instead of normal string add
|
|
|
|
|
|
| |
* fix #8225 isHidden was broken on posix
* scope rest of tos.nim under blocks to avoid variable scope bugs
|
|
|
|
|
|
|
|
|
| |
* fixes #8916 by removing `tyString`, `tySeq`, mod. marshal, typeinfo
Need to check in `typeinfo` for nil of the underlying pointer.
In marshal don't have to check for nil of seq anymore.
* remove reference to string, sequence in `isNil` doc string
|
|
|
|
|
|
|
|
|
|
| |
* testament: move to root dir (it's not a test)
* osproc: fix process index passed to afterRunEvent for parallel runs
it was passing the index of the process, not index of all commands
* testament: complete file move
|
|
|
|
|
|
|
|
| |
* Stdlib: Algorithm: Add shortcut versions of sort, sorted, and isSorted procs.
* Add tests for sort, sorted, and isSorted procs from algorithm module.
* Merge sort tests into tsortcall.nim, remove tsort.nim.
* Stdlib: Algorithm: Add shortcut versions of sort, sorted, and isSorted procs.
* Add tests for sort, sorted, and isSorted procs from algorithm module.
* Merge sort tests into tsortcall.nim, remove tsort.nim.
|
|
|
|
|
|
|
| |
* Replace `/bin/sleep` with just `sleep`, i.e. use environment variable
`$PATH` to locate binary.
* Replace `/usr/share/zoneinfo` with `$TZDIR` when it is defined,
fallback to hardcoded path otherwise. This is the same behavior that
Glibc2 normally have, see man 3 tzset.
|
| |
|
|
|
|
|
| |
removeFile() behavior should now be consistant between Windows and POSIX
Fixes #9200
|