lunes, 28 de diciembre de 2020
miércoles, 23 de diciembre de 2020
org, roam, zettelkasten links.
Here we have a couple of links talking about the new wave on PIM, bookmarking, concept-linking.
It used to be the case that each one of us had a smilar but not quite the same system. But it seems that zettelkasten, and roam are getting some gravitational pull so people are joining them.
Usual links are org-roam, zettelkasten, and another link to zettelkasten-in-plain-org
martes, 8 de diciembre de 2020
N Good Javascript Tutorials
There's so much about javascript on the web that it's always been hard (for me) to find good resources. But I think I found these N tutorials that are pretty good.
Good tutorials are hard to find and keeping the good links is important. I'm keeping also this docker tutorial. I just wish I've had it 3 years ago.
domingo, 29 de noviembre de 2020
A pipe inspector with tee
I've kept writing my scripting-field-guide, adding some more common pitfalls and cool tricks I've used in the last years.
Something I started using not long time ago is the "tee >()" incantation. It's super cool to be able to branch off the output of a command to another command, and make some sort of tree.
For now, there's this snippet I created to be able to inspect the contents of a pipe:
The default to the current timestamp isn't going to really work, as the string is evaluated only once, but I hope I'll get something more decent soon.
Another cool usage is when selecting something from a grep/fzf/dmenu and you want to do something with it like open that file, but also copy it to your clipboard.
The clearest example is my daily-zoom-selector, where I'm not just opening the room, but also copying it.
domingo, 15 de noviembre de 2020
Programming with Constraints
I've been following https://www.hillelwayne.com/ for some time and there's always something valuable to take to your daily life from each one of his posts.
Highest level is queuing theory and TLA+ stuff. But the couple of articles that touched home the most are his J lang article and the decision table patterns (and its intro from long time ago).
He uses productivity tools that reasonate a lot with my way of tooling. AutoHotKey, editors, minilanguages and, Constraint Propagation Systems.
On CPS, he talks about MiniZinc and OR-Tools. For me, Oz/Mozart rang a bell (from CPM book), and cl:screamer. I don't know if Z3 overlaps with it, but worth mentioning too.
Now onto my usage/takeaway of this: I used screamer to create a magic-square some time ago, and last week I was thinking if I could use screamer, Prolog, or PiLog to solve the coin change problem.
Well, as just today, I read about this MiniZinc tool and when this watching the MiniZinc videos, it was clear that yes, it should be possible, and it might be worth to try the coin change there. Here's what I came with (using screamer):
I haven't figured out how to do the performance analysis of this, but I suspect it will be less efficient than the usual manual way, because the only 'fitness' function is v=, but it's a complete hit-or-miss. once the current factors add up to an already bigger num than out target, this algorithm will keep trying "what if I add one coin of 1cent?", "and what about 2?".
IIRC, in CPM, there are some explanations of smarter CPS, but I'm not sure if they apply here, as there is only a single 'cut', which is the final objective function.
viernes, 13 de noviembre de 2020
Flow State
I've been subscribing more and more to newsletters lately. It's kinda RSS on your mail.
I discovered (in https://subreply.com, which is an "interesting" social network I tried once) this Music Newsletter called FlowState. And boy, it's SO GOOD. Relaxing non-vocal flowy music every day. There's jazz, there's (psy-)?ambient, new-age, tribal, house,... I'm surprised every day by a couple of playlists I can snap into spotify and start working.
Of course, reading mail in emacs makes that you can just automate the shit out of it. It placed my radios repo in a clear 2nd place on my daily music listening.
Here's an example of a great thing that appeared yesterday in Flow State. Anthony Braxton: Six Monk's Compositions (1987)
Enjoy.
martes, 10 de noviembre de 2020
On Writing
I've lately been a bit interested in writing style. The triggers were a couple of things:
1) People in my $ENV abusing extremely indirect-passive I-am-not-that-involved I-dont-give-many-fucks-but-I-talk-academically-to-seem-that-at-least-I-am-thoghtful. Yes, the problem probably lies in me, but I digress.
2) I discovered this writing plain English. This page is short, to the point, and I found it amazing that you can apply 99% of it to programming, and behaving, and many planes of your daily life. It caused a big impact. It's like a Fowler's article masked as an English writing guide.
3) https://news.ycombinator.com/item?id=41298774
Then "The Internet" started throwing links and videos at me about writing effectively, like this Steven Pinker one, or this other one aimed at academics writing articles, but with interesting insights from the University of Chicago. Also, did you know that George Orwell has a very cited text on English style? I didn't. But it's cool.
So, I haven't read 'The Elements of Style' or plan to (for now), but I can recommend all 4 links here. You can ingest them in a single day, with your non-tech-geek SO, and have thoughtful discussions. Long term, if something sticks, great. Else, you write a blogpost about those links so you can reference and reread them later on. :)
viernes, 30 de octubre de 2020
The Web 2.1
I've never done any kind of smart frontend. My Rails experience was more inside lib/ and app/{models,controllers} than in app/views or assets/ .
Over the years I tried a few frameworks to see if any of those 'clicked', but I didn't give time to any of them to sink in.
I the re-frame tutorials, but I didn't have any project of any size to try it.
I tried mithrill.js when I wrote my ultimate F5 crusher.
Long time ago I also gave a shot at intercooler.js, and seemed a very orthogonal, low-risk library to sprinkle pre-baked js into elements. And found in HN that its author moved to develop htmx.
Fast forward to this week. The article "If not SPAs, what?" in HN brought up htmx again, and it was paired with alpine.js, tailwindcss, and others. And it seems there's a kinda underground trend following the approach of totally detattched js/css on top of old classic Rails/Laravel/Django/YouNameIt.
Maybe this time I'll swing along with the pendulum.
jueves, 29 de octubre de 2020
Systems, Fun, Code, Dread, Drag, Chaos, GOTO 10
Here's a weird post (the links are good though).
While usual ups and downs in life and work, I try to keep my information intake as regular as I can. When I keep reading and learning from the sources I know do bring me balance, I'm giving the opportunity to get back to my regular ok-state.
Mood is a reinforcing feedback loop (self-optimizing machine), and if you don't cut it, it can tilt the system and change the equilibrium to a completely different point. And picking the right inputs help me slowing or reverting the feedback loop.
Few weeks ago, by a friend's recommendation I watched this talk by Jens Mönig , and today this one from _why. And talk about learning, and the fun, and the big ideas that make our profession something like explorers, tinkerers. They both question some of the pains we take for granted as inherent complexity of programming, when they are mostly incidental.
And it's "funny" I'm taking _why's inspiration, because at some point, he disappeared from the scene. Not sure about the reasons, but probably burnout? And we go to a grey-ish article about Surviving disillusionment.
The Soul of A New Machine, we see a case of engineering, business, pressure, people enjoying their craft at the same time that they are suffering the extreme contraints of time, tech, decisions made from upwards. But they thrive. And thriving is also a reinforcing feedback loop.
An internet person that helped me get up in a bump I had a few months ago is Jeremy Howard and his fastai courses and code. I saw him and I could easily take him as a model for how to code, approach problems, teach people, communicate, research (APL!), and even use vim! :) And it's very sad that he got bit by today's off-the-charts Code of Conduct policies and wrong-handling-gone-out-of-hand. I feel extremely sorry for him.
Another thing that happened recently to me is reading CHAOS by James Gleick. And again, patterns from randomness. Learning about chaos in order and order in chaos. They are part of what we are.
We like seeing patterns, seeing patterns when others just see noise. It's listening to jazz. And it takes time to teach your ear or eye on seeing those patterns.*
You see a series of numbers, and there's interference. or the series does not stabilize anywhere. First thing you try to do is find a pattern. Do the numbers grow always? Do they alternate between positive and negative? Maybe they are converging?
When things do not line up yet, you try to add a dimension there. Do they move faster every time (no matter if up or down)? Can I imagine the derivative of it being constant? or, is it the derivative of something that might have a pattern?
Can, that derivative be seen as a series, and try to apply the first analysis again? is it always growing? more extreme?..... (That feels like the enhanced optimization algorithm in "Why Functional Programming Matters").
So, ups and downs come in patterns, and sometimes their ups and downs come from very concrete explainable things, and sometimes they form out of a small disruption, or they start a turbulence of crazy chaotic ups-downs.
If not understanding it, can we foresee the chaos coming from a pattern of ups and downs? do we see a pattern, a f'(x), f''(x)? Are we approaching a singularity?
Fuck if I know.
* If we apply the learning lessons from _why and Jens, even if there has to be a basic intuition, it shouldn't be hard to see those patterns. But it is.
EDIT: https://hbr.org/2019/07/when-passion-leads-to-burnout. so true
miércoles, 28 de octubre de 2020
Some Tcl
Wanna spend an afternoon learning a scripting language that you didn't know about?
Tcl has appeared in HN recently a couple of times, and every time I read about it I remember that great article by antirez showing some very cool features of Tcl. So The link that appeared in HN today was a book by Hal Abelson and Philip Greenspun.
In the intro, It's funny how they compare Tcl and Lisp.
Anyway, the links:
- http://antirez.com/articoli/tclmisunderstood.html
- https://philip.greenspun.com/tcl/index.adp
miércoles, 14 de octubre de 2020
An emacs' Feature Development
So, in https://lists.gnu.org/archive/html/emacs-devel/2020-10/msg00691.html there's a proposal for an optimization in emacs, adding empty-directory-p so that elisp users don't have to (null (directory-files dir-name nil 'nodots t))).
And it makes sense to have a faster way. The person that proposed this improvement proposed a solution too. And it was a good one!
Then, Eli proposed something else. Some alternative implementation that:
- Allows to solve the problem at hand,
- Reuses existing code by adding a 'limit' to directory-files
- Easier to implement
- Makes the implementation more stratified. You can still create empty-dir-p by calling directory-files
- in case of passing that limit count to directory-files, we still get a list of files instead of a boolean. It's richer information, in case we need it.
After that, the conversation goes on by trying to figure out if the partial list of files will be useful at some point, or it's adding indeterminism and no value, and finding a balance on simplicity and usefulness.
All in all, a very good end-to-end conversation about a feature, its implications and its implementations with its corner cases and usability. Every time I see these conversations happening I feel this joy... I love when they happen in my team.
PS: Needless to say, this is a "simple" feature compared to bigger and more complex discussions going on in emacs-devel (which are hard problems that have no perfect solutions). But it's a good case study and there's something to be learned there about approaches, discussions, and building together.
Thanks to everyone involved!
sábado, 5 de septiembre de 2020
Radicle: Secure peer-to-peer code collaboration without intermediaries
That's a pretty neat project I've stumbled upon. Radicle.
It tries to do a really distributed code management solution by building upon a few concepts I consider super interesting and rock solid.
I'm gonna be throwing a few keywords that lighted up when reading about it (they might or might not appear as direct references in radicle's articles).:
- Git
- Merkle trees
- P2P
- gossip protocols
- IPFS
- Scuttlebut
- pijul
- nix
- Rust
That's a lot of cool stuff! I wish I had a bit more time, but lately I'm so much into Red language that I devote 80% of my free time to it. Still learning the basics of its toolchain, but it seems very impressive to me so far.
And here is something totally unrelated, but I enjoyed it so much I have to post it somewhere. A reverse engineering video of Contra (NES videogame from the 80's), with explanation of the konami code.
miércoles, 2 de septiembre de 2020
Ask Me Anything with Richard Gabriel, hosted by Stephen Kell
lunes, 20 de julio de 2020
tangling files with org-mode
Mostly using ":mkdirp yes :tangle path", is like doing a "cat block >>path". And you use (org-babel-tangle) as the exporter
#+begin_src elisp :mkdirp yes :tangle ~/.emacs (org-babel-tangle) #+end_src
jueves, 16 de julio de 2020
export all variables in bash
If you have a prefix, the coolest way is like the following:
export ${!KONG_*}
If you want everything:
eval $(printenv | awk -F= '{ print "export " $1 }')
miércoles, 8 de julio de 2020
so JIT, WOW
A Smalltalk-80 VM written in LuaJIT, that boots the images from the eighties:
https://github.com/rochus-keller/Smalltalk#a-smalltalk-80-interpreted-virtual-machine-on-luajit
Approachable tutorial on JITs. The second part talks about metatracing.
https://news.ycombinator.com/item?id=23740655
I recently discovered this guy and he's awesome. Haven't particularly examined this repo, but please, also check out his other stuff.
https://github.com/spencertipping/jit-tutorial
lunes, 29 de junio de 2020
Checking Password Strength in 10 Lines
To check password strength, we want different min lenghts for passwords depending if they have lower, upper, numbers, and simbols.
For this, there's passwdqc that allows you to do it in a very simple way, but, do you really need a library?
Here's the minimalistic implementation I came up with, which I think is pretty decent, and again, has some nice property I can't quite describe. The code is lua, but it can of course be translated to anything.
It has minimum lenghts for the passwords depending on the amount of different classes of characters it contains. If it only contains 1 type, we don't accept. for 2, minimum length 24,....
local str = io.read('*l')
local d = str:match("[0-9]") and 1 or 0
local down = str:match("[a-z]") and 1 or 0
local up = str:match("[A-Z]") and 1 or 0
local s = str:match("[!@#$^&*()_=+-]") and 1 or 0
local l = #str
local defs = {math.huge, 24, 11, 9}
print(d,down,up,s,l,l>=defs[d+down+up+s])
viernes, 26 de junio de 2020
Some Thoughts on Ergonomics and Compression
Why is vim so addictive, and somehow it's difficult to explain to non vim fanatics? I think it's a reification of the process of walking through a text file and doing stuff to it. A concrete way to talk about processes onto text files. Some feel it is strictly superior to GUIs because you can get ahold of it. you can write it down, put it in a postcard, and you have a handle to it. You type it again and it works. there's no syntax or fuzziness or stuff that can go wrong (TM).
Next question: Can you ahold an algorithm in your head? in the same concrete way you hold 'yypVr-'?
I'm lately quite interested in Array Languages and I'm reading some snippets of Apl/J/K. And the feeling is the same. Everything else looks so wasteful and error prone like the point-and-click looks to vimmers.
Example:
Shuffling a vector – breaking ⍵ down into ⍺ pieces from which another vector is built by merging. E.g. if is 'abcdefghij' and is 3, the pieces are 'abcd', 'efg', and 'hij', and the result is 'aehbficgjd':
⍵[⍋⍋(⍴⍵)⍴⍳⍺]
The ergonomics are pretty different from what we're used to, but there's definitely an emergent property there. It's not just "it's shorter to type".
martes, 26 de mayo de 2020
Perl & Ruby do APL
- https://www.youtube.com/watch?v=UBl6t7zNfwE
- https://zverok.github.io/blog/2020-05-16-ruby-as-apl.html
jueves, 7 de mayo de 2020
Temporally Quaquaversal Virtual Nanomachine
I've enjoyed this talk so much I'm gonna post it here: Great as always, Damian Conway doing his particular 'GEB' on physics and programming: https://www.youtube.com/watch?v=ORjyXcLDd9M
Also, Keep Ruby Weird 2018, the same as !!Con, very interesting talks.
https://www.youtube.com/watch?v=v32XHJxljKI&list=PLE7tQUdRKcyaxIbXihF5bRdMumqVtGrT4&index=5
EDIT: 2020-11-10. Found https://marak.com/blog/2013-05-13-time-loop-software
miércoles, 6 de mayo de 2020
Recreational vimming
When I have to do some sort of development or file editing inside a container, I usually have vim there but not emacs. docker-tramp is very useful but sometimes I just want to edit there.
The .vimrc I have in my container has only one line (I can't function without it):
imap jk
Let's say I'm editing a lua script. After I've saved and c-z and run
the file several times, I realize what I want is to have is::nore ,rr :!lua %
Then I can test it much quicker. But I realize I'm always :w
before,rr
. Colon, up, and modify the line to::nore ,rr :w:!lua %
Accidentally I quit vim and realize I have to set that again, so I go to my vimrc and add this:nore ,rr :w:!lua %
nore ,vimrc :e ~/.vimrc
nore ,so :source ~/.vimrc
With this I have a pretty nice way to iteratively finetune my config.
After some lua editing, the only thing I need to do often (and not
provided by the excellent vim default functionality) is to comment and
uncomment code.nore ,cc :s/^/--/
nore ,cu :s/^\( *\)--/\1/
This gives normal and visual comment/uncomment functionality, and
enough interactivity to build your ad-hoc shortcuts as you go. This is an example that just happened yesterday, and the nice thing is that it grows and flows from 0. I couldn't get to this amount of functionality from an
emacs -Q
in such a small time. It has
such a different feeling to configuring emacs. It reminds me of my
Perl days, it's fun and quick. And the language is very orthogonal, with
very few abstractions. It's the APL of text editing.This is my take on this reddit thread.
domingo, 26 de abril de 2020
What's in a git merge conflict?
How come git knows which side is which, and when there is a conflict or where there isn't?
I have the notion of the common ancestor to base the versions off of, but when people do heavy cherry-picking (which is mostly a single branch operation).... how come git reconciles the contents?
Well... as usual, things in git are..... simpler?
https://stackoverflow.com/questions/4920885/what-constitutes-a-merge-conflict-in-git
lunes, 13 de abril de 2020
John Conway's Game of Life
https://www.jsoftware.com/papers/eem/life.htm
https://news.ycombinator.com/item?id=22845249
https://www.youtube.com/watch?v=a9xAKttWgP4
And a recent ode to J, that explains the first prototype that Arthur Withney and Ken Iverson wrote in an afternoon. I remember having great fun deciphering it 3 years ago on the flights back and from $WORK at that time, and people staring at me reading that printed code and WTFing.
viernes, 3 de abril de 2020
Indeterminate dimensionality
Scientists like to be able to locate things by giving a ``vector'', that is, a list of coordinates in a space of known dimensionality. This is one of the reasons they like orthogonality--it means the various components of the vector are independent of each other. Unfortunately, the real world is not usually set up to work that way. Most problems, including linguistics problems, are a matter of ``getting from here to there'', and the geography in-between has a heavy influence on which solutions are practical. Problems tend to be solved at several levels. A typical journey might involve your legs, your car, an escalator, a moving sidewalk, a jet, maybe some more moving sidewalks or a tram, another jet, a taxi, and an elevator. At each of these levels, there aren't many ``right angles'', and the whole thing is a bit fractal in nature. In terms of language, you say something that gets close to what you want to say, and then you start refining it around the edges, just as you would first plan your itinerary between major airports, and only later worry about how to get to and from the airport.
lunes, 30 de marzo de 2020
Simplicity is its own reward
Amazingly classy and to the point. All 3. I'm learning so much reading this maillist. And still a lot to learn.
Bravo, and thanks.
Stefan Monnier: >> Any objection?
>
Eli Zaretskii: > What are the advantages? The original problem is solved, and
> everybody agreed that having a dead buffer in the pdumped area is
> nothing we should bother about.
>
Daniel Colascione: With Stefan's patch, Emacs is simpler. Simplicity is its own reward.
Original thread: https://lists.gnu.org/archive/html/emacs-devel/2020-03/msg00922.html
domingo, 29 de marzo de 2020
personal journals
Here are some recent links talking bout them. Also, if you look for org-mode articles, you'll find some interesting workflows.
- https://fs.blog/2014/02/decision-journal/
- https://blog.trello.com/decision-journal
- https://neilkakkar.com/the-human-log.html
- https://neilkakkar.com/How-to-see-Systems-in-everyday-life.html
Links on JITs
- https://abe-winter.github.io/2020/03/28/jitu-brutus.html
- https://developers.redhat.com/blog/2020/01/20/mir-a-lightweight-jit-compiler-project/
- https://akrl.sdf.org/gccemacs.html
- https://news.ycombinator.com/item?id=22711391
jueves, 19 de marzo de 2020
TRAMP with docker is awesome
What I'm using TRAMP more often for is to login to containers.
Using docker-tramp, I usually browse into a docker and start dired there. But then, I can open a shell (or eshell if there's no bash) there.
And, for example, if you run a postgres container, why not opening a `sql-postgres` buffer?.
Just:
docker run -e POSTGRES_PASSWORD=a -e POSTGRES_USER=rgrau -ti --rm postgres
and when dired-ing through tramp, m-x sql-postrgres using the appropriate params. Tada!
Neat, ain't it?
Happy hacking, and stay safe.
pipes on steroids
Pipes are great. You know that, I know that, everyone knows that. Because/But they are restricted to linear, non conditional flow.
Sometimes, I'd like to have an out-of-band pipe that bypasses a command in the middle, and there's no clear way how to do it.
So here are a few links on how to use file descriptors for advanced use cases. You can use them for this, and for other smart stuff in shells.
- https://catonmat.net/bash-one-liners-explained-part-three
- https://wiki.bash-hackers.org/howto/redirection_tutorial
- http://tldp.org/LDP/abs/html/ioredirintro.html
- http://catern.com/posts/pipes.html
- https://mosermichael.github.io/jq-illustrated/dir/content.html
- https://news.ycombinator.com/item?id=21700014 ( https://www2.dmst.aueb.gr/dds/sw/dgsh/ )
- http://dongyuxuan.me/posts/pipeline.html
- https://stackoverflow.com/questions/2990414/echo-that-outputs-to-stderr
- http://www.tldp.org/LDP/abs/html/io-redirection.html
- http://wiki.bash-hackers.org/howto/redirection_tutorial
- https://news.ycombinator.com/item?id=22704774
domingo, 15 de marzo de 2020
reverse engineering courses
https://pwn.college/
https://guyinatuxedo.github.io/
martes, 25 de febrero de 2020
not all containers are made equal
- https://wiki.archlinux.org/index.php/systemd-nspawn
- https://voidlinux.org/news/2017/12/advent-containers.html
- https://www.infoq.com/articles/containers-hypervisors-2019/
- https://github.com/p8952/bocker
- https://dev.to/napicella/containers-from-scratch-in-18-lines-of-code-3pmn
- https://ericchiang.github.io/post/containers-from-scratch/
- https://news.ycombinator.com/item?id=15608435
- https://www.ardanlabs.com/blog/2020/02/docker-images-part1-reducing-image-size.html
And here is a cool 'build-your-own-docker' talk
jueves, 20 de febrero de 2020
Larry Tesler RIP, Bert Sutherland RIP
There are a bunch of stories in these HN links:
- https://news.ycombinator.com/item?id=22361282
- https://news.ycombinator.com/item?id=22370667
jueves, 13 de febrero de 2020
Transitive closure in k, and more
About 10 years ago I was having those feelings with the Shwartzian transform and JAPHs around the net. Perl is the gateway drug.
Btw, if you want some more, https://www.youtube.com/watch?v=v7Mt0GYHU9A or https://www.youtube.com/watch?v=hzPd3umu78g .
lunes, 10 de febrero de 2020
spicing up your prompt
On every emacs startup, and every 24 hours, you get a different message on your prompt when 'm-x'.
Happy hacking,
domingo, 26 de enero de 2020
disable screen blank/sleep on idle
Void is minimalist and lightweight, with a textual installation process, like vectorlinux had (using text dialogs and menus).
I just found out that the way to keep the screen from going blank after some mouse/keyboard idle time is xset s off -dpms. That saves you from any ad-hoc command line fu when watching movies with that girl.
jueves, 23 de enero de 2020
Latest Awesome Emacs Developments
We know that in free software projects (communities, that is) some branches might take a long time to develop, but some others
tree-sitter: Integrating this project opensourced by github. This could mean a new way of syntax highlight that doesn't drag, smarter indentation, and completions. Eli mentioned it in the emacs mail list and people are looking into it.
Yet another jitter, by Andrea Corrallo. Another approach to make emacs' elisp code run faster. There have already been many attempts to this (Guilemacs, "El Compilador", and others). Will this be the one? From the highest level perspective, I like "el compilador" the most, because it's kinda smalltalkish, but hey,... I don't have the knowledge to hack on any of those, so whatever the wizards pick, I'm good with it. Also, see mailing list.
SystemE : Replace Systemd with runit? nope, geekier.
Emacs Application Framework because you can also have proper gui controls.
Animations in elisp (text)
OM. higher level org parsing
doct declarative org-capture templates.
More META-II
That thing alone already deserves a detailed browsing of the whole blog.