Hacker Newsnew | past | comments | ask | show | jobs | submit | more eXpl0it3r's commentslogin

Thank you, glad you liked it!

If you have any libraries on your list that is missing on mine, let me know!


Do you know what Foxit Reader does for the "printing" part? Does it convert it to XPS or PS?


Most of my research was directed at PDF creation and less at editing, so I'm not sure the list captures everything available.

For example I somehow dismissed PdfPig [1] early on, because it's mostly for text extraction from PDFs, but it does support some basic editing of sorts.

[1] https://github.com/UglyToad/PdfPig


You're welcome!

Having played around with MigraDoc for the past few weeks, I do still recommend it, as long as you don't need more complex layouts. Here's a short and certainly incomplete list of limitations that I've run into so far:

- No tables within other tables

- No multi-column page layouts

- No multi-section on the same page (new section = new page)

- No letter spacing

- MigraDoc doesn't know about the final spacing, so you can't adjust say the width of some table column automatically. Either calculate an estimated based on the text/content or space them equally.

- Can't shade (background color) only a selection of words in a text

- Lists can only have up to three different symbols

- List indentation can behave quite strange, due to tabstops

- No horizontal rule (can be emulated)

- There's a bug with bottom border of a paragraph

On the other hand, MigraDoc & PDFsharp as less than 1MB and plenty fast, so it's a great package, as long as you can build some workarounds to achieve the desired look.


Just today I looked at LaTeX interop for C#, but it seems the TeX world is in its own bubble of commandline tools.

Do you use any library or are you just calling the standard TeX CLI tools?


It is misleading in so far that XSLT is an independent standard [1] and isn't owned by Google, so they cannot "kill it", or rather they'd have to ask W3C to mark it as deprecated.

What they can do is remove support for XSLT in Chrome and thus basically kill XSLT for websites. Which until now I didn't even know was supported and used.

XSLT can be used in many other areas as well, e.g. for XSL-FO [2]

[1] https://www.w3.org/TR/xslt-30/ [2] https://en.wikipedia.org/wiki/XSL_Formatting_Objects


You say they cannot kill it, and yet they are about to. We'll see who wins, reality or your word games.


What are you talking about? They can’t kill it. Most use is outside the browser. It’s not about mixing words.


Except a lot of people wouldn't participate in a peer-to-peer network for fear of legal repercussions.


Utilizing p2p tech is not illegal. It is illegal to redistribute copyrighted content without authorization- and we are working to build this into the protocol so that peers will respect copyright by default. People can redistribute at their own risk. I'll be the first to admit that this is complicated, and we have a long way to go in this regard.

Plus, the vast majority of people will just use the web frontend, with a peer on the server. Most peers can be hosted by content creators and tech-savvy friends+family.


Almost every machine in the world participates in at least one peer-to-peer network: Windows Update. There was a time when the Steam client also used bittorrent technology, not sure if they still do.


Obviously P2P gets used in various things, my point was just, that (most) people likely won't willingly join P2P networks to fight "censorship" or help archive things with questionable content or tainted with potential copyright infringements.


It seems the PDFSharp rabbit hole goes even deeper than I've realized!

Latest MigraDoc & PDFSharp seem to have been updated and ported to .NET 6 after a lot of the forks happened, so it was unclear to me whether there's merits in looking at other, mostly abandoned forks.

I might add PdfSharpCore, though the use of SixLabors.ImageSharp and SixLabors.Fonts leads to a disqualification from the "quest", given their custom split license [1]

Edit: Actually, the license seems to turn into an Apache 2.0 license, when used with an open source licensed project and also as transitive dependency. Certainly a confusing license.

[1] https://github.com/SixLabors/ImageSharp/blob/main/LICENSE


Edit: PSA - PdfSharpCore uses older releases of SixLabors.ImageSharp v1.0.4 and Fonts-1.0.0-beta17 which both were (and are still) distributed under plain Apache-2.0.

https://web.archive.org/web/20251104163604/https://codeload....


Good to know, thank you!

Though, makes me wonder how much "old code" this is then collecting...


If it works, it works. And specifically, Works For Me ™ :)


For the uninitiated, what's a "hybrid linear attention architecture"?


1/4 of their layers are conventional quadratic attention


Could someone explain every term in this subthread in a very simple way to someone who basically only knows "transformers are a neural network architecture that use something called 'attention' to consider the entire input the whole time or something like that", and who does not understand what "quadratic" even means in a time complexity or mathematical sense beyond that "quad" has something to do with the number four.

I am aware I could Google it all or ask an LLM, but I'm still interested in a good human explanation.


Transformers try to give you capabilities by doing two things interleaved (in layers) multiple times:

- apply learned knowledge from its parameters to every part of the input representation („tokenized“, ie, chunkified text).

- apply mixing of the input representation with other parts of itself. This is called „attention“ for historical reasons. The original attention computes mixing of (roughly) every token (say N) with every other (N). Thus we pay a compute cost relative to N squared.

The attention cost therefore grows quickly in terms of compute and memory requirements when the input / conversation becomes long (or may even contain documents).

It is a very active field of research to reduce the quadratic part to something cheaper, but so far this has been rather difficult, because as you readily see this means that you have to give up mixing every part of the input with every other.

Most of the time mixing token representations close to each other is more important than those that are far apart, but not always. That’s why there are many attempts now to do away with most of the quadratic attention layers but keeping some.

What to do during mixing when you give up all-to-all attention is the big research question because many approaches seem to behave well only under some conditions and we haven’t established something as good and versatile as all-to-all attention.

If you forgo all-to-all you also open up so many options (eg. all-to-something followed by something-to-all as a pattern, where something serves as a sort of memory or state that summarizes all inputs at once. You can imagine that summarizing all inputs well is a lossy abstraction though, etc.)


Afaik there are two types of attention, cross and self attention. It's quadratic becase you have to process one set of tokens with another, like calculating a matrix product. Originally designed for translation, you'd take tokens in one language on one side and the other language on the other, then compute the relevance of each word with each other which the model then uses further to more accurately generate the translation.

With self attention you compute every token in a sequence with every other token in that same sequence, figuring out which word references which other word (e.g. "George is sitting in the park. He's reading a book.", "He" would correlate with "George", letting the model know what it refers to). Of course these are also trained layers so what the model thinks correlates with what and how that info is used in the DNN perceptron part is depends wholly on the training process.

There is no free lunch with this and with only 1/4 of layers having it, the model will perform significantly worse at identifying relevant info and likely decohere a lot compared to having it on every layer. But since you get rid of the quadratic complicity, it'll be much faster. Think "I'm doing 1000 calculations per second and they're all wrong" meme. So far there have been lots of attempts at doing linear-ish attention (e.g. Google doing the sliding window hackery that only computes a part of the vectors and hopes for good locality, mamba combinations with RNNs, Meta removing positional encodings in attention in the trainwreck that was LLama4, etc.) and they've mostly failed, so the holy grail is finding a way to make it work since you get the best of both worlds. The top performing models today all use fully quadratic attention or combine it with sliding windows in some layers to claw back some speed in long context scenarios at the cost of some accuracy.


There are different varieties of attention, which just amounts to some kind of learned mixing function between tokens in a sequence.

For an input of length N (tokens), the standard kind of attention requires N squared operations (hence, quadratic - it scales with the square of input length). You have to check how every token attends to every other token.

There are a bunch of alternative mixing functions which are instead linear with respect to N. Every additional token costs the same amount of work. The typical method is to have a constant size state manipulated recurrently, which necessarily implies some level of lossy compression in the state (quadratic attention doesn't really have state in this sense - it computes and checks every possible relation always).

Linear attentions kind of suck in comparison to quadratic attention but the efficiency is very attractive, especially at inference time where you don't need more VRAM to store more context.

TLDR; conventional attentions scale N^2 time, N space (kv cache), and are exact. linear attentions scale N time, constant space (recurrent state), and are lossy.


Hey thanks for asking this question. It lead to good replies


Is the problem coffee or caffeine?

I'm not the best at this either, but enough sleep really does wonders to focus.

What also helps me with focus is the pomodoro technique in some form, basically setting myself a timer, within which I want to fully focus, no distractions, followed by a short break.


Fair point—sleep and time-blocking are probably the highest-leverage interventions. I've been using pomodoro on and off but find I still need something to get into the focused state, especially on days when sleep wasn't great.

The caffeine question is interesting. For me it's less about needing stimulation and more about managing the side effects of what I'm already using (coffee). If I could get the alertness without the jitters/anxiety, that'd be the win. But you're right that fixing the root cause (sleep, focus discipline) is probably more sustainable long-term.

Curious—do you avoid caffeine entirely, or just use it strategically?


I don't like the taste of coffee, but consume probably an unhealthy amount of caffeine through other means.

My question was mostly if the coffee itself is the cause of the side effects, you could still consider other ways to consume caffeine, assuming it's the caffeine that provides the alertness to being with.


Weed. It's natures perfect combination.


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

Search: