HN user

fooofw

100 karma
Posts1
Comments38
View on HN

I believe this might be slightly imprecise also.

The traceback is actually shown based on the last-thrown exception (that thrown from the finally in this example), but includes the previous "chained exceptions" and prints them first. From CPython docs [1]:

When raising a new exception while another exception is already being handled, the new exception’s __context__ attribute is automatically set to the handled exception. An exception may be handled when an except or finally clause, or a with statement, is used. [...] The default traceback display code shows these chained exceptions in addition to the traceback for the exception itself. [...] In either case, the exception itself is always shown after any chained exceptions so that the final line of the traceback always shows the last exception that was raised.

So, in practice, you will see both tracebacks. However, if you, say, just catch the exception with a generic "except Exception" or whatever and log it without "__context__", you will miss the firstly thrown exception.

[1] https://docs.python.org/3.14/library/exceptions.html#excepti...

My version of Firefox (146.0 on Debian) has exactly this. If I select a sentence and right-click, I get the menu item "Translate selection to <LANGUAGE>". In the resulting box, I can change the language pair - but the defaults that I have seen were also reasonable.

https://support.mozilla.org/en-US/kb/website-translation has the text: "A new Translate selection feature has been added starting in Firefox version 128, that enables you to highlight and translate selected text."

Edit: Sorry, I misread the comment to say that there was no such menu item. Edited to reflect this.

It's kind of fun to compare this formulation with the seemingly contradictory official arXiv argument for submitting the TeX source [1]:

1. TeX has many advantages that make it ideal as a format for the archives: It is plain text, it is compact, it is freely available for all platforms, it produces extremely high-quality output, and it retains contextual information.

2. It is thus more likely to be a good source from which to generate newer formats, e.g., HTML, MathML, various ePub formats, etc. [...]

Not that I disagree with the effort and it surely is a unique challenge to, at scale, convert the Turing complete macro language TeX to something other than PDF. And, at the same time, the task would be monumentally more difficult if only the generated PDFs were available. So both are right at the same time.

[1] https://info.arxiv.org/help/faq/whytex.html#contextual

That would (mostly if not always) work in the sense of reproducing the layout of the pages, but would defeat the purpose of preserving the semantic information present in the TeX file (what is a heading, a reference and to what, a specific math environment, etc.) which is AFAIK already mostly dropped on conversion to PDF by the latex compiler.

Why have you failed though? Is the point to try to deceive people to think that XKCD actually published something else? Why not modify the xkcd one without hinding the fact that you modified it?

HTTPS by default 9 months ago

What defines private sites, I wonder – beyond "such as local IP addresses like 192.168.0.1, single-label hostnames, and shortlinks like intranet/"?

This made me think of Microsoft's MarkItDown tool/library [1] which seems to have quite the overlap in supported file formats [2,3] and conversion options [4]. I couldn't find any reference to the library on the website, so it may be useful to know about.

[1] https://github.com/microsoft/markitdown

[2] https://tomd.io/#supported-extensions

[3] https://github.com/microsoft/markitdown/tree/main/packages/m...

[4] https://github.com/microsoft/markitdown/blob/8a9d8f15936b206...

I was curious, so I looked up arc in the PostScript Language Reference [1]. It contains the following (p. 530):

The arc is represented internally by one or more cubic Bézier curves (see curveto) approximating the required shape. This is done with sufficient accuracy to produce a faithful rendition of the required arc. However, a program that reads the constructed path using pathforall will encounter curveto segments where arcs were specified originally.

[1] https://www.adobe.com/jp/print/postscript/pdfs/PLRM.pdf

I'm not sure that fully explains it here. I see more relevant search results below the "People also watched" section (just checked now). Further down, there is also "For you" and "Previously watched" which have videos of no discernible relevance to the query and these are also followed by again more relevant search results.

I feel like the fact that Meta (and anyone) can see posts and users regardless of whether or not they are defederated is a bit of a distraction.

However, I do see the point of considering ways for instances to somehow distance themselves from Meta's instance. If another instance/admin was publicly known to comparably engage in pervasive user tracking (both on and off their own websites) and algorithmic attention monopolization, would we not expect many other actors in the fediverse to defederate or otherwise distance themselves from those practices/that instance? Obviously, several instances have decided to do so by premptively saying they will defederate. I'm just saying that I think it makes sense to at least consider it. E.g., compare the labels the data collected by the Threads Android app (https://play.google.com/store/apps/datasafety?id=com.instagr...) to those of the Mastodon one (https://play.google.com/store/apps/details?id=org.joinmastod...), and I at least see the contrast.

But perhaps this is just me being naively unaware of rampant community-sanctioned indiscriminate collection of user data in the fediverse (I'm not part of it, just curiously observing Meta's entry).

If we're in the business of listing alternative ways to evaluate elisp (not to diminish IELM or the elisp modes of course), I can think of two other common ways to evaluate elisp.

* Eshell (launched with M-x eshell) is a shell in Emacs which uses a language that has elements from elisp. In particular, expressions in parentheses are evaluated as elisp forms [1]. Eshell is a shell (like e.g. bash), so it also has syntax to conveniently evaluate external commands, though it lacks some common shell functionality such as job control [2] and some types of redirection [3].

* Org Babel elisp source blocks [4,5]: In Org mode, use "#+begin_src elisp" and "#+end_src" to delimit lines with elisp and evaluate using C-c C-c, which will, by default, insert the result of the evaluation below the source block. This can be useful, if you want to keep a more organized record of the evaluated commands and their results in comparison to a REPL.

[1] https://www.gnu.org/software/emacs/manual/html_mono/eshell.h...

[2] https://www.gnu.org/software/emacs/manual/html_mono/eshell.h...

[3] https://www.gnu.org/software/emacs/manual/html_mono/eshell.h...

[4] https://orgmode.org/manual/Working-with-Source-Code.html

[5] https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-...

For anybody following along with the examples, a few points/tips that might help newcomers:

1. (By default) before you can use Python source blocks, you need to have the Org Babel Python functionality loaded which is most easily done by evaluating the elisp (require 'ob-babel), but there are other ways also [1].

2. The first example, which uses the print function, will not output anything because the Python blocks by default are evaluated inside a function body and the return value is returned to Org [2]. To return the printed output instead, you need the header argument ":results output". There is an example of this syntax later in TFA.

3. If you are serious about replacing (or complementing) other Jupyter tools with Org mode, you might want to eventually look at emacs-jupyter [3], which provides a more advanced handling of outputs and also supports other (i.e. non-Python) kernels.

Also, I don't think I've ever seen anything like the debugging example and when I tried to replicate it out of curiosity, the block simply failed with a bdb.BdbQuit exception. Am I missing something? What is supposed to happen?

[1] https://orgmode.org/manual/Languages.html

[2] https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-...

[3] https://github.com/nnicandro/emacs-jupyter