HNHacker News
TopNewBestAskShowJobs

_pvxk

2,353 karma · joined September 16, 2010

submissionscomments
_pvxk··on Useful Uses of cat
Oh and another one I use all the time is as an "identity transform" when selecting between filters, e.g.

    dostuff () { 
        if [[ $1 = clean ]]; then 
            grep -v dirt
        else 
            cat
        fi | do_other_stuff
    }

See also https://www.in-ulm.de/~mascheck/various/uuoc/ (via https://lobste.rs/s/rtvp2u/useful_uses_cat#c_0xpqkr )
_pvxk··on Stoßlüften: Shock Ventilation
And in Bergen you can use "lukt" to mean both, "høyt opp i lukten", maybe the Hanseatic influence?

(My kid uses "luft" to mean both, "lufte ekkelt".)

_pvxk··on Welcome to the ad-free internet
https://www.datatilsynet.no/en/news/aktuelle-nyheter-2023/th...

> the Norwegian Data Protection Authority strongly doubts that Meta's proposed ‘consent’ mechanism, often dubbed ‘pay or okay’, complies with the GDPR. The EDPB’s decision is therefore important to avoid Meta's infringement continuing while the company is exploring its options.

https://www.theregister.com/2023/11/28/metas_eu_privacy_fee_...

> noyb (None Of Your Business) has filed a data protection complaint against Meta over the "Pay or Okay" subscription model

_pvxk··on Eoops: An object-oriented programming system for Emacs-Lisp (1992)
Well, being an Operating System, there have been many things programmed "in Emacs":

* email, slack and reddit clients * web wowser * tetris * Amazon's customer service handling https://tess.oconnor.cx/2006/03/quality-without-a-name (not sure what that says about Emacs Lisp. Or Amazon.) * PIM / OCD management software * video editing https://www.nongnu.org/gneve/ * mind control https://github.com/jonnay/mindwave-emacs * Thermonuclear word processor * vim and vi emulators, if you ever need to use it for coding * Internet of Toys https://news.ycombinator.com/item?id=29207607 * Air traffic control system https://news.ycombinator.com/item?id=33524683

_pvxk··on GnuCash Tutorial and Concepts Guide
It's for the UI, yes, since they're not my accounts, I'm just tech support for them ;-) I've seen there is an hledger-web, but there's a bunch of reports and workflows already set up in Gnucash and switching would involve learning new things and I'd rather spend as little time as I can on accounting and taxes. (OTOH adding a script to enable "git log -p" took like ten minutes.)
_pvxk··on GnuCash Tutorial and Concepts Guide
I store the .gnucash file in git, and after editing things in Gnucash I run a script that exports[0] it to a hledger file in the same directory and commits both. So `git show` gives me a readable view of what changed, but the accounts are still usable by non-nerds.

[0] https://hledger.org/gnucash.html

_pvxk··on DRM-free e-books are a big deal (2019)
Big stores that sell DRM-free e-books:

- https://www.ebooks.com/en-uk/drm-free/

- https://www.bloomsbury.com/uk/

DRM-free audiobooks:

- https://libro.fm/

- https://www.downpour.com/

Other lists and tips on where to buy DRM-free:

- https://libreture.com/bookshops/

- https://aperiodic.net/phil/archives/Geekery/where-to-get-ebo...

(Here in Norway we've so far been lucky, I've yet to see e-books with DRM. There's ebok.no which does watermarks, but that feels acceptable.)

_pvxk··on Should I Haskell or OCaml?
I was in a similar position using Python at work. At first I learnt Ocaml on the side, which was really fun, and taught me to work with types instead of avoiding thinking about them as I did with C++. Then I got a job where I got to write "simple" Haskell – picking up Haskell after Ocaml was no problem, mostly just felt like a change of syntax. It's been fun, and for the domains I've used it for (mainly combining data from various sources, analysing, predicting), a very good fit. Also used it for web stuff with IHP lately, which has also been a success.

The Haskell ecosystem is somewhat larger than Ocaml's (more support, users, learning materials, libraries). The difficulty with Haskell is mostly that it makes abstraction so easy that you can be tempted to make your code too abstract. But if you can manage to KISS, it can feel like a safer, cleaner, faster Python. Haskell doesn't require you to code in pure functions, but it will let you know through the types that a function is not pure / is "in IO", and it has lots of features to let you easily do things purely that you would otherwise do in IO. That may lead to more of your code being pure in the end. F#'s main advantage is access to the C# ecosystem, though at the cost of possibilities for null pointers when calling C# libraries / .NET API's.

_pvxk··on Advanced techniques for reducing Emacs startup time
gitignore the .elc's
_pvxk··on Command-line Tools can be 235x Faster than your Hadoop Cluster (2014)
> The value isn’t in the pure execution time, it is in everything around it.

Especially for those of us who get paid for developing, designing, supporting, architecturing, meetinging, catering, conferencing and maintaining everything around it :-)

_pvxk··on Destroying C with 20 lines of Haskell: wc
* isSpace handles tabs, but looking at a single byte at a time it won't handle all the multibyte space symbols you can have in unicode. If you read further down, they rip out the remains of unicode handling for further speed improvements.

* Looking at a single byte at a time, it presumably only handles the "C" locale :) They don't say what locale GNU wc was tested with (if it's not LANG=C, that benchmark should be re-run)

* --max-line-length? no. But I'm guessing GNU wc isn't benchmarked with that option on (can't find the invocation in the blog post though)

* data State { ws, bs, ls } keeps count of words, bytes (more honest than calling it characters) and lines.

_pvxk··on Popcount CPU instruction
https://haskell-works.github.io/posts/2018-08-22-pdep-and-pe... from the series https://haskell-works.github.io/ shows how to use popcnt (and rank-select) in a Haskell CSV parser
_pvxk··on Xfce 4.14
> [session manager] can now run commands not only "autostart style" at login time, but also when your computer suspends, logs out etc.

> larger thumbnails as well as support for a "folder.jpg" file altering the folder's icon

> "Do Not Disturb" mode

> HiDPI support

_pvxk··on If you want to understand Silicon Valley, watch Silicon Valley
I remember reading a story about someone who got fired from some Silicon Valley tech job, and they almost immediately revoked their key card, so they got stuck in the staircase and had to wait for someone to hold the door open so they could get out of the building. (As if getting fired wasn't bad enough, you have to beg favours from random passers-by.)
_pvxk··on ZSH, tmux, Emacs and SSH: A copy-paste story
All these workarounds sound like a reason to use start using tramp more (apropos, https://www.youtube.com/watch?v=dljNabciEGg / http://www.howardism.org/Technical/Emacs/literate-devops.htm... is a pretty neat demo of combining org-babel and tramp).

-----

There is also emamux, which seems to be able to copy from tmux: https://github.com/syohex/emacs-emamux/#emamuxyank-from-list...

_pvxk··on The Craft of Text Editing: Emacs for the Modern World (1999)
A buffer doesn't have to correspond to a file, e.g. "built-in" stuff like Messages or Help or scratch. I often "C-x b asdlkfj RET" to create a new "scratch" buffer for quickly jotting down something or transforming something. I can of course save that buffer to file, or I can just kill it.

When coding elisp, you often use the (with-temp-buffer …) macro to do more or less the same thing :-)

Also, several buffers can correspond to one file: "C-x 4 c" runs clone-indirect-buffer-other-window which creates two views on one and the same file. This is not the same as splitting the window: The two buffers can each have their own, different narrowings applied. Say you have two functions defined in one file, they're almost the same, so you want to compare them. Now, clone the buffer, narrow the first buffer to the first function, the second to the second, and now you can run ediff on the two buffers :-) Or you can even open the same file in different major modes at the same time …