HNHacker News
TopNewBestAskShowJobs

Pete_D

1,119 karma · joined November 22, 2013

submissionscomments
Pete_D··on The design side of programming language design
It always felt to me like when people use words like "intuitiveness" or "usability", they're all pointing at slightly different things. Matt Fuller's partitioning of user-friendliness into "easy to use", "easy to learn", and "easy to use without learning"[0] feels like it might be easier to set objective criteria for. For your example, you might say functional programming tends to be easy to use, but hard to learn and hard to use without learning.

(I'm not current on PL/HCI literature, so it wouldn't surprise me if they already have these concepts, just with different labels.)

[0] https://www.over-yonder.net/~fullermd/rants/userfriendly/2

Pete_D··on IDA: What's new in 7.00
If I'm reading this right, the blacklist only applies to people who leak their legally purchased copies, not everyone who's ever used a pirated copy.
Pete_D··on Why I Fell in Love with Arch Linux (2015)
Have you tried Gentoo?

I switched from Arch to Gentoo a few years ago (before systemd was on the radar). After installation, which is admittedly more involved, I found it felt much the same as Arch for day-to-day usage. And, for all the possible criticisms of Gentoo, you'll definitely feel in full control of your system.

Pete_D··on Interesting commands for the Linux shell
Not a command as such, but I recommend skimming the readline man page[0] and trying some of the bindings out to see if you're missing out on anything. I went years without knowing about ctrl+R (search command history).

[0] http://man7.org/linux/man-pages/man3/readline.3.html#EDITING...

Pete_D··on Interesting commands for the Linux shell
Yes; it's a readline command called quoted-insert and is by default bound to ctrl-V in both modes.

    $ set -o vi; bind -q quoted-insert
    quoted-insert can be invoked via "\C-v".
Pete_D··on Sublime Text 3.0
I'd recommend this even for non-emacs users who use terminals a lot. The tiny bit of extra comfort from ctrl-C in a shell alone is worth it. Add in tmux ctrl-B, or any readline shortcuts you use a lot, and you're onto a winner.
Pete_D··on Curl’s backdoor threat
Frama-C lets you prove all sorts of useful properties about C code, including memory correctness. (Actually writing the proofs is a lot of work though.)

https://frama-c.com/acsl.html

Pete_D··on The Windows Shutdown crapfest (2006)
For some very stubborn processes, I've had to resort to attaching to them using windbg.exe and killing it from there.
Pete_D··on The significance of plot without conflict (2012)
My dictionary (Pleco) says: "introduction, elucidation of the theme, transition to another viewpoint, and summing-up-- the four steps in composing an essay".

I would guess that kishōtenketsu is a loanword from this, qĭchéngzhuănhé.

Pete_D··on Unix Time 1500M – Friday July 14 02:40UTC
A calendar of the upcoming 100M anniversaries:

    $ for x in {15..21}
    > do
    > printf '%2d %s\n' $x "$(
    >   env TZ=UTC date -d "@$(($x*100000000))"
    > )"; done
    15 Fri 14 Jul 02:40:00 UTC 2017
    16 Sun 13 Sep 12:26:40 UTC 2020
    17 Tue 14 Nov 22:13:20 UTC 2023
    18 Fri 15 Jan 08:00:00 UTC 2027
    19 Sun 17 Mar 17:46:40 UTC 2030
    20 Wed 18 May 03:33:20 UTC 2033
    21 Fri 18 Jul 13:20:00 UTC 2036
It's neat how they seem to roll around every pi years.

    >>> 1e8 / (3600 * 24 * 365.25)
    3.168808781402895
    >>> math.pi
    3.141592653589793
Pete_D··on Apple adds a tracker blocker to desktop Safari
Maybe the next frontier in browser anti-tracking is to stop sending a User-Agent header, or to build in functionality like one of the browser add-ons that randomly pretend to be different browsers.
Pete_D··on Helping a Million Developers Exit Vim
Shift-key slippage kept biting me so hard that I gave up and bound an unshifted key to command mode (personally `nnoremap <Space> :`). No more accidental :Q.
Pete_D··on Linux utils that you might not know
I had this problem recently. The solution was to install Python 2.7 as a software collection: https://www.softwarecollections.org/en/scls/rhscl/python27/

This installs it to /opt/rh, and you can run commands that need them with "scl enable python27 mything" or by sourcing /opt/rh/python27/enable in a script to set up PATH, etc.

Pete_D··on Is the C++ preprocessor still needed?
A while ago, in a fit of defmacro-envy, I wrote a preprocessor that would let you wrap Python snippets in #python/#endpython blocks: http://codepad.org/5B388Wsh. This lets you write silly things like http://codepad.org/eS443WPA. I bet the same idea isn't too hard to implement in Ruby, but I don't know enough to try it myself.

I never really used it much - generating C code with Python print statements turned out to look uglier than I thought it would, and most of my use cases were better handled with X macros (https://en.wikipedia.org/wiki/X_Macro) or by generating a separate file and #include'ing it. But your description reminded me of it; you might like the idea.

Pete_D··on Show HN: NumPop, a small mathematical puzzle game
Wow! I don't think I've ever got close to that.

When I was first toying with the concept, I wrote a C implementation and tried a depth-first-search AI to see what kinds of scores were possible. As I remember it, it would get 400+ scores on good runs. The best it got was over 4000, but that must have been with an extremely lucky sequence of numbers.

Pete_D··on A curated list of Terminal frameworks, plugins and resources
I would add rxvt-unicode to the terminals list. Its client/server model makes opening new terminals practically instant.
Pete_D··on Fasting diet 'regenerates diabetic pancreas'
I am not a doctor. May I refer you to the following paper?

https://www.ncbi.nlm.nih.gov/pubmed/6859052 "Vigorous supplementation of a hypocaloric diet prevents cardiac arrhythmias and mineral depletion."

I wrote a comment a few months ago on fasting supplementation you may find interesting. https://news.ycombinator.com/item?id=12455415

Also seconding the recommendations to talk to a doctor before you do anything. I know that usually goes without saying, but it deserves emphasis given the article is about diabetes. As the current top comment points out, fasting can be very dangerous for diabetics.

Pete_D··on Tips to Improve Your Mental Math Ability
There's a great segment in one of Richard Feynman's books where he talks about picking up tricks like this, and ends up beating an abacus salesman in a cube-root-finding race. I think it involved memorizing log tables.
Pete_D··on Harvey Friedman bringing incompleteness and infinity out of quarantine
At the risk of asking a naïve question, why do you think the Peano axioms are ugly? As a mostly-lay mathematician I always thought they were quite elegant.
Pete_D··on Htop Explained Visually
At a guess: LO is requesting (via mmap) enough memory up front to represent a full spreadsheet with data in every cell from A1 to the bottom-right corner, and letting the OS supply pages for the small parts of the spreadsheet that are actually accessed. AIUI this is a common technique for big sparse arrays.
Pete_D··on Questionable “Young Blood” Transfusions Offered in U.S. As Anti-Aging Remedy
Somewhat OT, but kidney donation is surprisingly low risk in the long term.

"Compared to the general public, most kidney donors have equivalent (or better) survival, excellent quality of life, and no increase in end-stage kidney disease"

https://nhsbtdbe.blob.core.windows.net/umbraco-assets/1433/1... [PDF, page 7]

Pete_D··on Working on Chrome made me develop a tool for reading source code
gdb's pretty printing API is documented in the texinfo manual, most usefully this page: http://sourceware.org/gdb/current/onlinedocs/gdb/Writing-a-P.... I use it a lot, and love it, but I haven't used VS's XML thing to compare. For looking up API documentation I usually drop into `python-interactive` from within gdb and do e.g. `help(gdb.printing)`.

Though, you're still limited to string representations that way. If I want to examine a really complex datatype, I'll sometimes write a gdb command to dump some kind of GraphViz output and run it through dot. Or come up with a json representation and explore it using jq or ad-hoc python filters.

Looking at your ideal tool checklist - I think it would be possible to build this on top of gdb. I wrote a prototype a while ago that would launch a HTTP server from the gdb prompt, and then you could control it via websockets. Never took it past recreating the prompt with an <input> tag, but someone who was better at front-end work could conceivably do all sorts of nifty data visualizations with it.

Pete_D··on Getting Rid of Comments on Vice.com
I'm always surprised Slashdot-style tagged voting isn't more widespread, and curious what would happen if more communities tried it.

One can imagine it reducing tensions by allowing different subpopulations to have different views of the same conversation - e.g. some people might want to filter "Funny", others wouldn't mind. If the tags are an open set, you might see other use cases evolving, like being able to jump to the highest-ranked "TL;DR"-tagged comment, or deprioritizing comments tagged "Complaint about article formatting" (much as I tend to agree with those, they do seem to be contentious).

Pete_D··on Withdrawal from Antidepressants
I'd heard of brain zaps before quitting Zoloft cold turkey[0], but the actual experience wasn't what I expected from the term "brain zaps". Kind of like a dizzy spell that lasts 0.1 seconds, with a sort of buzzing sensation, like someone had turned on a step-down transformer in my skull. I've never experienced anything else like it to compare it to.

[0] in hindsight, not tapering gradually is a really bad idea

Pete_D··on System loads web pages 34 percent faster by fetching files more effectively
I usually only see lynx and friends mentioned as jokes, but 'elinks --dump <url> | less' really can be a huge readability improvement for some articles.
Pete_D··on UK's new Snoopers Charter just passed an encryption backdoor law by the backdoor
I think Blair almost certainly would have backed this. The other day I rediscovered this article from 2008 about councils using RIPA to catch people littering and flytipping:

http://www.telegraph.co.uk/news/uknews/3333366/Half-of-counc...

> The Tories condemned the latest figures as further evidence that the law had become a "snooper's charter". "Under Labour, the rights and liberties of law-abiding citizens are being eroded through plans for ID cards, sinister microchip spies in bins and abuse of anti-terror laws by councils," said Eric Pickles, the party's communities spokesman.

Strange reading nowadays. I wonder what Eric Pickles makes of it all.

Pete_D··on Buttery Smooth Emacs
I made the vim -> emacs+evil switch a few months ago, no spacemacs.

What drew me to it at the time was emacs --daemon and emacsclient, which lets you have the same view of the same files open in different terminals or GUI windows ("frames") and saves you from the "file already open" warnings you would get from vim when e.g. editing a file and browsing ctags in different terminals.

Things I found annoying after the switch:

* lack of tabs (situation may have changed since I switched; there's an evil-tabs package but I haven't used it. By now I just got used to emacs' way of doing buffers and frames)

* I feel like I'm fighting the built-in bindings a lot in cases like e.g. dired-mode (directory browser) and Ibuffer-mode (buffer listing)

Notes which you may find useful if you decide to try it out:

* While emacs will work in a terminal, I've found it more comfortable to use the GUI, because it saves me having to think about why e.g. trying to look up help triggers a backspace (C-h).

* my evil config, for an example of some settings and how to tame bindings: http://pastebin.com/TxxuSU8u. Not just mine, a lot of people post their init.el online, and they're often a good reference.

Pete_D··on CPP: A Standardized Alternative to AMP
Maybe we could just send the raw markdown anyway - it might not be pretty on all clients, but it should be _legible_ on all clients.

Or maybe we could send markdown if the user agent included text/markdown in the request's Accept header, and pipe it through a markdown->HTML filter otherwise.

I would love to see some kind of native markdown support on the web.

Pete_D··on Fasting triggers stem cell regeneration of damaged, old immune system (2014)
I'm not a doctor, but see https://en.wikipedia.org/wiki/Refeeding_syndrome
Pete_D··on Fasting triggers stem cell regeneration of damaged, old immune system (2014)
I am not a doctor.

On days I don't eat, I supplement various vitamins and electrolytes to minimize risks of refeeding syndrome[0] and heart problems[1,2]. I don't know how bad the risks are in practice for these for short fasts (I've only gone up to 3 days), but I am sufficiently paranoid that I supplement anyway. Supplementing electrolytes also means I don't get headaches, restless leg syndrome, or (as much) weak feeling in muscles, all of which I used to get when I tried unsupplemented water fasting.

I also try to break the fast with skim milk or yoghurt so that I'm not phosphate depleted (refeeding syndrome again).

For what it's worth, my supplement regime amounts to: a generic A-Z multivitamin, 800mg potassium chloride, 300mg magnesium citrate (it seems to be important that it's citrate for bioavailability reasons), 800mg calcium, and a B-vitamin complex (as I remember it, vitamin B1, or thiamine, is important when refeeding, for reasons I can no longer find).

[0] https://en.wikipedia.org/wiki/Refeeding_syndrome

[1] http://ajcn.nutrition.org/content/34/4/453.short

[2] http://www.ncbi.nlm.nih.gov/pubmed/6859052

← PreviousPage 7 of 8Next →