226 karma · joined Jan 3, 2012 (14y ago) · 45 submissions
comment 1w ago · link · parent
similar: I've just shared a cli command to see images, SVGs, PDF, Word, Excel, Markdown, html, etc. on Kitty-compatible terminals :-)
2.
Show HN: Clview – a universal doc viewer for the terminal(github.com ↗)
3 points · by ferd · 1w ago · discuss
comment 1mo ago · link · parent
The most underrated font ever.
comment 6mo ago · link · parent
https://neuroning.com/boardgames-exercise/notebooks/walkthro...
The implementation makes it really easy to add new piece types or rules. For example, here's the full logic for rooks (sans castling):
(defn expand-pmove-for-rook [pmove]
(->> pmove
(expand-pmove-dirs [↑ ↓ ← →])
(pmoves-discard #(or (pmove-on-same-player-piece? %)
(pmove-changed-direction? %)))
(map pmoves-finish-capturing-opponent-piece)
(pmoves-finish-and-continue))))comment 8mo ago · link · parent
Exchanging messages with people on the other side of the world felt like magic at the time (even though it took many hours/days for a msg to round-trip)
I also run "Sudaka's BBS" based on Maximus/2, with many interactive "apps" I'd developed using Maximus' proprietary C-like language. Great high-school times.
I can still hear my parents complaining about my monopolizing the phone line every night :-)
comment 1y ago · link · parent
For example, driving a car without the aids makes my tinnitus really bad (due to the background noise of the car/engine/wind/road). With aids it's a lot less of a problem.
One fear I have is if hearing aids cause even more hearing damage (after all, what they do it inject amplified sound into you ear... the exact same thing that most doctors tell you NOT to do to avoid hearing damage)... Experts tell me they don't, but without any reasonable explanation.
comment 1y ago · link · parent
If object A calls a method of object B (composition), then B cannot call back on B, and neither A nor B can override any behavior of the other (And this is the original core tenet of OO: being all about "message-passing").
Of course they can accept and pass other objects/functions are arguments, but that would be explicit and specific, without having to expose the whole state/impl to each other.
comment 1y ago · link · parent
That's the point: You can reuse code without paying that price of inheritance. You DON'T have to expect co-recursion or shared state just for "code-reuse".
And, I think, is the key point: Behavior inheritance is NOT a good technique for code-reuse... Type-inheritance, however, IS good for abstraction, for defining boundaries, to enable polymorphism.
> I'd say this is a fact of life for all pieces of code which are reused more than once
But you want to minimize that complexity. If you call a pure function, you know it only depends on its arguments... done. If you can a method on a mutable object, you have to read its implementation line-by-line, you have to navigate a web of possibly polymorphic calls which may even modify shared state.
> This is another reason why low coupling high cohesion is so important
exactly. Now, I would phrase it the other way around though: "... low coupling high cohesion is so important..." that's the reason why using inheritance of implementation for code-reuse is often a bad idea.
comment 1y ago · link · parent
Closer to the "ideal": declarative approaches, pure functions, data-oriented pipelines, logic programming.
comment 1y ago · link · parent
comment 1y ago · link · parent
That is: an instance of a subclass calls a method defined on a parent class, which in turn may call a method that's been overridden by the subclass (or even another sub-subclass in the hierarchy) and that one in turn may call another parent method, and so on. It can easily become a pinball of calls around the hierarchy.
Add to that the fact that "objects" have state, and each class in the hierarchy may add more state, and modify state declared on parents. Perfect combinatory explosion of state and control-flow complexity.
I've seen this scenario way too many times in projects, and worse thing is: many developers think it's fine... and are even proud of navigating such a mess. Heck, many popular "frameworks" encourage this.
Basically: every time you modify a class, you must review the inner implementation of all other classes in the hierarchy, and call paths to ensure your change is safe. That's a horrendous way to write software, against the most basic principles of modularity and low coupling.
comment 1y ago · link · parent
Original idea from here: https://medium.com/@evnbr/coding-in-color-3a6db2743a1e
One impl for Emacs: https://github.com/ankurdave/color-identifiers-mode
I still admire you Niki.
comment 1y ago · link · parent
A mobile app to track tasks, events and any info about anything you care about: your car, home, tools, workshop, appliances, pets, lab equipment... anything really.
Lets you organize "resources" in a hierarchy (like "folders"). You can then define tasks, add pictures, geolocation, contacts, notes, events, etc to them. Recently added the feature to "share" resources with others.
Google Play: https://play.google.com/store/apps/details?id=com.code54.qui... App Store: https://apps.apple.com/us/app/obsetico/id6749025870
It's so generic that it's hard to describe :-) I need a better elevator pitch.
comment 1y ago · link · parent
comment 1y ago · link · parent
Somewhat related: I've recently wrote a code-walkthrough (in Clojure) of modeling chess-like games.
https://neuroning.com/boardgames-exercise/
It's very basic and intended for teaching/learning functional programming, not a real library or engine like the OP.