| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
* Move typetraits.`$` to system. Fixes #5827.
* revive PR; adjust code to make sure everything works and add tests
* fix tests/concepts/tstackconcept.nim
* address comments
|
| |
|
|
|
| |
Fixes #9999.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(#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.)
|
| |
|
| |
|
|
|
|
|
|
| |
* Stop false positives in distros.nim
* Fix bad string comparison on line 176 of distros.nim
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
* [os] fix #10017 regression
* [os] fix #10025 regression
|
|
|
|
| |
add tests for vmops (#9925)
|
|
|
| |
Just minor addition to the documentation with the use of operators
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Allow an escape hatch for platform specific flags (of which there are many,
for example MAP_POPULATE itself is a Linux-only thing, not other Unix).
Continue with same defaults as before in this commit, but that really
should be changed to *not* include MAP_POPULATE. While pre-faulting
all the pages can be useful sometimes *if* you know you're going to
access all the data, it is highly unlikely to be what users expect the
default to be. For some things all that up front work is 1000s of
times slower than being lazy/on-demand/only ever faulting parts of the
file. Even the MAP_POPULATE fan who originally in 2014 committed to
this file defaulted it to off (but turned it always-on as a "temporary"
work around for some long since gone/mutated compiler issue).
Anyway, at least something like this `mapFlags` gives users the ability
to override the poor default choice or activate any other idiosyncratic
platform-specific features.
* Use simple, efficient default flags, but also accept whatever the open/mapMem
caller specifies. Save flags in MemFile so they can be used in `resize`.
This field should not need exporting like the others -- callers can always
save whatever values they pass -- but we include a cautionary comment in
case anyone ever asks for a `*` there, as well as for documentation.
Also make documentation for ``mapFlags`` in open more likely to inspire care.
|
| |
|
| |
|
| |
|
|
|
|
| |
compiler/pathutils.nim; added os.relativePath
|
|
|
|
|
|
|
|
|
| |
covered (#9930)
* Give error when case has an else branch even though all cases are already covered.
* Don't check for invalid else for type tyFloat..tyFloat128, tyString, tyError
* Remove unnecessary else in unittest.nim
* Fix sockets.nim
|
|\
| |
| | |
Added basic AF_UNIX support to asyncnet.
|
| |
| |
| |
| |
| |
| |
| |
| | |
Unfortunately this required some code duplication because the
doConnect() from asynccommon.nim only works with addrInfo which does not
make sense for AF_UNIX.
makeUnixAddr() was moved to nativesocket.nim and exported
|
|\ \
| | |
| | | |
Add runnableExamples for strmisc procs and a better doc for expandTabs
|
| | | |
|
|\ \ \ |
|
| | | | |
|
| | | | |
|
| |\ \ \
| | | | |
| | | | | |
Let handles be seen outside of `memfiles` module so that "updating"
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
discussion (with special mremap usage on Linux, but ordinary munmap, mmap on
other POSIX). Someone needs to do the when windows branch.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Updating accessors are also provided since the idea of this change is to
allow "updating" operations external to the module which are by their very
nature closely tied to module internals (as well as to OS interface details).
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
operations (like eg., resizing a file and re-mapping) do not need
to worry about race conditions of re-opened paths, renamed parent
directories and that sort of thing. Operating directly on already
open handles is both safer and more efficient than relying upon the
stability of filesystem paths.
|
| |\ \ \ \
| | | | | |
| | | | | | |
add SinglyLinkedList.append procs
|
| | | | | | |
|
| |\ \ \ \ \
| | | | | | |
| | | | | | | |
refs #9880 show index and bound in lots of `index out of bounds` errors
|
| | | | | | | |
|
| | | | | | | |
|
| | | | | | | |
|
| |\ \ \ \ \ \
| | |_|_|/ / /
| |/| | | | | |
Fixes #9907
|
| | | | | | | |
|
| | |/ / / / |
|
| |\ \ \ \ \
| | |/ / / /
| |/| | | | |
Merge async common into asyncdispatch.
|
| | | | | | |
|
| | | | | | |
|