nprescott
Joined 12 years ago
Joined 12 years ago
sqlite> create table users (id blob primary key not null, created_at text not null, username text not null);
sqlite> create unique index idx_users_on_id on users(id);
sqlite> pragma journal_mode=wal;
sqlite> .load '/tmp/uuid.c.so'
sqlite> .timer on
sqlite> insert into users(id, created_at, username)
select uuid(), strftime('%Y-%m-%dT%H:%M:%fZ'), 'hello'
from generate_series limit 100000;
Run Time: real 1.159 user 0.572631 sys 0.442133
where the UUID extension comes from the SQLite authors[2] and generate_series is compiled into the SQLite CLI. It is possible further pragma-tweaking might eke out further performance but I feel like this representative of the no-optimization scenario I typically find myself in.In the interest of finding where the bulk of the time is spent and on a hunch I tried swapping the UUID for plain auto-incrementing primary keys as well:
sqlite> insert into users(created_at, username) select strftime('%Y-%m-%dT%H:%M:%fZ'), 'hello' from generate_series limit 100000;
Run Time: real 0.142 user 0.068090 sys 0.025507
Clearly UUIDs are not free![0]: https://news.ycombinator.com/item?id=27872575
[1]: https://idle.nprescott.com/2021/bulk-data-generation-in-sqli...
> Optional components of a distribution may be specified using the extras field:
identifier_end = letterOrDigit | (('-' | '_' | '.' )* letterOrDigit)
identifier = letterOrDigit identifier_end*
name = identifier
extras_list = identifier (wsp* ',' wsp* identifier)*
extras = '[' wsp* extras_list? wsp* ']'
as well as explaining their behavior, albeit briefly:> Extras union in the dependencies they define with the dependencies of the distribution they are attached to.
The resolution on . is explained by the pip documentation[1]:
> pip looks for packages in a number of places: on PyPI (if not disabled via --no-index), in the local filesystem, and in any additional repositories specified via --find-links or --index-url. There is no ordering in the locations that are searched. Rather they are all checked, and the “best” match for the requirements (in terms of version number - see PEP 440 for details) is selected.
[0]: https://peps.python.org/pep-0508/#grammar
[1]: https://pip.pypa.io/en/stable/cli/pip_install/#finding-packa...
I don't tend to do anything very interesting to tax the filesystem so it is most important that things just work day to day and the less maintenance the better. I found a few use cases[0] for the copy-on-write abilities of Btrfs (built into systemd-nspawn) after switching but even that was a case where something I was previously doing was made instantly faster rather than working out a btrfs incantation.
I've recently been trying out a nifty backup tool[1] to try out a snapshot feature locally. This one did require two btrfs specific commands to restore a backup (`btrfs {send,receive}`). Once again though, this was an additional feature I decided to try out and not really required for my day to day. For me personally Btrfs has been easy to adopt because of how low-friction it has been to add and learn incrementally.
I've still not learned ZFS.
[0]: https://idle.nprescott.com/2022/systemd-nspawn-and-btrfs.htm...
In this specific case it is probably obvious enough that hey maybe I need to try scrolling randomly to find "baccalaureate" but the particular form that drove me to capture the above was littered with similar cases where it wasn't at all obvious. More than anything though the invisible scrollbars just meant I had to second guess every single form I ever submitted.
(org-babel-do-load-languages 'org-babel-load-languages '((python . t)))
(setq org-babel-python-command "~/mpl-venv/bin/python")
Are you perhaps on an outdated version of Emacs?There have been a few different fixes around the "last line" return value over the years[0][1] but I can't really remember something like your example not working for me personally.
[0]: https://lists.gnu.org/archive/html/emacs-orgmode/2017-11/msg...
I know igalia[0] was working on this but I haven't been following the bug trackers directly. Their site and news section gives a better sense of the progress and includes small demonstrations with many of their updates.
quicksort=: (($:@(<#[) , (=#[) , $:@(>#[)) ({~ ?@#)) ^: (1<#)
quicksort ⤆ ((∇⍛(<#⊣) , (=#⊣) , ∇⍛(>#⊢)) ({⍨ ?⍛#))⍣(1<#)
[0]: https://wjmn.github.io/posts/j-can-look-like-apl/[0]: https://idle.nprescott.com/2020/why-bother-with-markdown.htm...
[1]: https://sourcehut.org/blog/2020-05-27-accessibility-through-...
I've been surprised at how much I liked writing it. J can be derided for being a "puzzle language"[1], which isn't entirely unfair, but I've found the paradigm of array programming carries over into more widely used languages and libraries ("Iverson ghost"[2]).
I wouldn't bother learning to put it on a resume, I would try it out for fun.
[0]: https://idle.nprescott.com/2020/ray-tracing-in-j.html
[1]: https://prog21.dadgum.com/219.html
[2]: https://analyzethedatanotthedrivel.org/2018/03/31/numpy-anot...
While it isn't too active, the most recent activity was in the last week or so, I think all that remains are some figures and tables for a couple chapters, the index and proof-reading[0]. It's very nearly there due to a lot of work on Josef's part.
The specific example is of number input routine allows signed decimal numbers without power-of-10 exponents (fixed-point, in FORTRAN parlance) and comes from the author's book Scientific Forth, where a fuller example is used ... to determine whether a piece of text is a proper identifier (that is, the name of a variable, subroutine or function) according to the rules of FORTRAN.
I originally heard of Scientific Forth from Programming in the Twenty First Century where it made a list of "Five Memorable Books about Programming"[3] with the following description:
Dr. Noble demonstrates how he uses Forth for hardcore matrix work and, when he realizes that RPN notation isn't ideal in all circumstances, develops a translator from infix expressions to Forth.
[0]: https://news.ycombinator.com/item?id=22746708
[1]: https://news.ycombinator.com/item?id=22748785
[2]: previously 3, 6 and 8 years ago, never any comments: https://hn.algolia.com/?dateRange=all&page=0&prefix=true&que...
email: [email protected]