41 karma · joined Sep 10, 2020 (6y ago) · 25 submissions
comment 2y ago · link · parent
On second glance, I guess this is what you're getting at with the ArcSwap comment in the post. It sounds like you really do want to reallocate the whole State and atomically swap it with the previous state, which would make reusing the prices Vec impossible, at least without keeping around two States and swapping between them.
Anyway, tone aside, I still think the comment had validity in a general optimization sense, even if not in this specific case.
comment 2y ago · link · parent
https://github.com/ntBre/anpass - ordinary least squares fitting https://github.com/ntBre/intder - internal coordinate transformations https://github.com/ntBre/spectro - vibrational perturbation theory
PRIMA looks very interesting, by the way. I may see if I can get some use out of it in my research!
comment 2y ago · link · parent
This quote from the linked PRIMA page pretty much sums up my experience porting the above code too: "I hope I am the last one in the world to decode a maze of 244 GOTOs in 7939 lines of Fortran 77 code — I did this for three years and I do not want anyone else to do it again"
comment 2y ago · link · parent
https://www.theverge.com/2020/8/6/21355674/human-genes-renam...
comment 3y ago · link · parent
(defun open-term-here ()
"open st in `default-directory`"
(interactive)
(call-process-shell-command
(concat "st bash -c \"cd "
default-directory
" && exec zsh\"")
nil 0))comment 3y ago · link · parent
https://github.com/spegoraro/org-alert/blob/master/org-alert...
comment 3y ago · link · parent
I was recently looking at nushell, and that website has exactly what I would expect to find: example input with screenshots of the output instead of a video.
comment 3y ago · link · parent
comment 3y ago · link · parent
comment 3y ago · link · parent
In my case, one of the Fortran files essential to my group's research has 11 (!) versions with only filenames like file.f.goodworking (that's literally one of the extensions) to differentiate them and no version control or history.
comment 4y ago · link · parent
... | awk '{print $2}'
I thought there was all this confusing syntax, but something like awk '/pattern/ {print}'
was more clear to me. In the first case, the empty pattern matches every line of the input, and the action is simply to print the second field of each line. Patterns can vary in complexity from the empty pattern to long chains of logical operators and regular expressions, such as /pattern/ in the second example. The outer quotes are just to prevent the shell from eating your dollar signs or other special characters. In a standalone AWK script you can write it like /pattern/ {
print
}
which also makes it look more like another language.If you can get your hands on a copy of The AWK Programming Language, it's a pretty quick and pleasant read that helped everything make more sense to me. I do most of my data analysis for my research using AWK and really enjoy working with it.
comment 5y ago · link · parent
I started using computers much more recently, but wouldn't any OS that boots into a TTY provide a pretty similar experience? I'm genuinely curious since I've never used a Commodore or BASIC. Is that environment much different from bash or another shell?
comment 5y ago · link · parent
comment 5y ago · link · parent
comment 5y ago · link · parent
I think the one-liner would be better as
for i in [0-8]*/*.sql; do psql -U <user> -h localhost -d <dbname> -f $i ; done
or even better as something like find . -name "*.sql" -exec psql -U <user> -h localhost -d <dbname> -f {} \;
[1] http://mywiki.wooledge.org/ParsingLs