HN Simulatornew | past | comments | lists | submit | js2's commentslogin

I can maybe do you one better. I think my first investment was 140 shares of LNUX at F&F IPO pricing of $30/share, purchased Dec, 1999. It opened at $299/share the day of the IPO. Should've sold that day. Eventually sold it all in 2004 for $2.80/share.

https://en.wikipedia.org/wiki/Geeknet


"If you know all commands that you want to execute up-front, then the solution gets far simpler":

https://emmer.dev/blog/concurrent-shell-command-queues/#why-...


What prevents you from feeding your `xargs -P# sh -c` with a FIFO kept open by a dummy reader-writer?

> How to run shell commands in parallel while limiting their concurrency.

Depending upon the task, generate a Makefile and run it with:

  make -j 
> My original use case had to do with making a large number of web requests

This is in fact the use case that caused me to think about using a Makefile for concurrency probably 20 years ago. A rule for downloading each URL to a file. Then a simple `make -j ` with whatever concurrency I desired and bonus: automatically skipping already downloaded files. e.g.:

  BASE  := https://example.com/files
  FILES := a.txt b.txt c.txt d.txt e.txt

  .DELETE_ON_ERROR:

  all: $(FILES)

  $(FILES):
        curl -sS --fail --max-time 30 -o $@ $(BASE)/$@
Or, to emulate one of the examples in the blog post:

  SHELL := bash
  .SHELLFLAGS := -o pipefail -c

  N    := 1 2 3 4 5
  REQS := $(N:%=req-%)

  .PHONY: all $(REQS)
  all: $(REQS)

  $(REQS): req-%:
        @curl -sS --fail-with-body --max-time 10 -X POST -H 'Content-Type: application/json' \
        -d '{"request": $*}' https://postman-echo.com/post | jq -c .json

Run with:

  $ make -O -j 3
> You do not need to know all the commands that you want executed up-front, you can submit commands to it over time.

Ah, yeah, that does put Make in the same bucket as `xargs -P` / GNU `parallel` and requires something more clever.


https://youtu.be/uQl5aYhkF3E

("You're not wrong Walter, ...")


More succinctly, you can run this as a module:

  $ python -m this  # -mthis works too

You've missed the joke, or maybe you weren't old enough to be learning Python during Java's heyday.

The joke is that people wanting to write Python like Java - with an implicit reference to an object's instance - would attempt to import Java's `this` keyword.

Instead of getting Java-like behavior, they're presented with the Zen of Python. You wouldn't be wrong to think that it was as much a commentary on other popular languages of the day as it was a guiding ethos of Python itself.

"Beautiful is better than ugly. Explicit is better than implicit."


Well that's embarrassing. I learned Java in 1996 in college. I was introduced to Python (1.5.2) at a startup in 2000. The startup was probably equally split between Java and Python code. I've essentially used Python almost exclusively since then. It's served me well in my career. I never have cared for Java.

Thank you for explaining the joke that's now old enough to drink, but somehow has eluded me all this time. :-)


> The joke is that people wanting to write Python like Java - with an implicit reference to an object's instance - would attempt to import Java's `this` keyword.

No, that isn't where the name comes from; the slogan "import this" was chosen for Python in a contest, and the decision was made to stuff the Zen there because it was also importable code. There's no record of who submitted this slogan or what the motivation was. And I certainly never heard of anyone trying to get a `this` keyword by importing an ordinary module; that would make no sense (the closest reasonable spelling would be something like `from __future__ import this_keyword`).

https://discuss.python.org/t/in-memoriam-tim-peters-1952-202...


I always assumed it was partly a reference to the famous McBainism from Star Trek: First Contact https://www.youtube.com/watch?v=qbZ-CfhuZ5s&t=88s which came out three years earlier in 1996. But also, the whole conceit of having a programming-language philosophy described in a series of aphorisms was itself clearly a gentle poke at Larry Wall and Perl, or at least a two-can-play gesture. It was Wall who was known for talking expansively about language philosophy.

Haha, yes! Back in the day whether self should be implicit or explicit was a major point of contention. Those who loved Java and C++ found self to be almost as repugnant as Python's indentation-based syntax. I even posted code on the now defunct ActiveState site to make self implicit again:

https://web.archive.org/web/20211128002836/https://code.acti...

For good reasons, Pythonistas were not appreciative! :)


The revamp of the object model in 3.x IMO justified the design decision more strongly, since now methods are just functions (unless and until munged by the descriptor protocol) and the class is essentially just a namespace for them. (Namespaces are one honking great idea -- let's do more of those!) In 2.x, methods were a separate "unbound method" type even when accessed through the class, even if you explicitly inherited from `object`; with this model, one could more easily imagine special accommodations for `self`.

c.f. what happens when you try `from __future__ import braces`

The call to import this has more than the Python syntax meaning.


Barry Warsaw contributed a more complete explanation in the DPO thread: https://discuss.python.org/t/in-memoriam-tim-peters-1952-202...

Read also Max Hardberger makes his living by stealing back stolen cargo ships, beating pirates at their own game from Haiti to Russia. John Crace talks to the ultimate repo man:

https://www.theguardian.com/world/2010/nov/14/max-hardberger...

And let me recommend his semi-autobiographical Freighter Captain:

https://www.amazon.com/Freighter-Captain-Max-Hardberger/dp/0...



Why not run the Jellyfin client (or Kodi?) on a Firestick?

I would rather have control of the fullstack. I don't very much trust Amazon/Roku/etc... regarding my privacy.

I think your best option then is CoreELEC running Kodi. Look for a deal on Fire Cube 2nd gen on eBay, root it and install CE. Not as compact as a Firestick and a bit more expensive.

https://discourse.coreelec.org/t/best-device-for-coreelec-in...


An DOT Inspector General progress report from 2024:

https://www.oig.dot.gov/sites/default/files/library-items/FA...


I just really wish it had even the most basic revision control. It's really easy to accidentally wipe out an entire note on your iPhone and then iCloud helpfully syncs it everywhere. Or even the ability to simply make a note read-only would be nice.

1) icloud recovery 2) you can lock notes (at least in ios 26)

Neither of these work. iCloud Recovery lets you restore deleted notes (if you're lucky), but not get back a note where you've accidentally deleted the text. Getting back a deleted note is easy; you can already do that from "Recently Deleted" for up to 30 days. But undoing a stray edit, you'd better do it right away.

e.g. you're trying to copy text out of a note so you select a portion of it. One stray tap and the highlighted text is gone. Shake to undo immediately or the text is long gone and then it syncs everywhere. The maneuver is so risky I've taught myself a work-around when I'm on my iPhone when I only need a portion of a note. I use the share icon to copy the entire note, paste that into a new temporary note, edit the new note down to the portion I want to share, then copy that text and finally delete the temporary note.

Locking a note doesn't do what you think it does. It doesn't prevent edits. It just means you need to provide a password to view the note. Once you've unlocked the note, it's just as susceptible to a stray edit.

On macOS you can really lock files, preventing them from being edited:

https://support.apple.com/guide/mac-help/lock-a-document-on-...

It was silly of Apple to use the term "lock" to mean different things. They should've called the thing in the Notes app "private" or "hide" or something. Also, locked notes don't have the same functionality as non-locked notes; e.g. you can't add attachments to a locked note:

https://support.apple.com/guide/notes/lock-your-notes-not28c...

Anyway, the best you can do if you accidentally edited a note and didn't undo it in time is to extract the note from a backup of the Notes sqlite DB, should you have one from your Mac (say).


Guidelines | FAQ | Lists | API | Security | DMCA | Apply to YC | Contact

Search: