Hacker Newsnew | past | comments | ask | show | jobs | submit | mh-cx's commentslogin

You might like

The Dream Machine: J.c.r. Licklider and the Revolution That Made Computing Personal by M. Mitchell Waldrop

Not really about a company, though.


Can someone explain what this is? The page has almost no information (on mobile) and I don't want to install just to find out.


Grayjay is a video player for YouTube and other services. I believe its ad-free and "algorithm-free", meaning it just gives you every video from every channel you subscribe to, in chronological order. It was initially for Android and iOS.

It's backed by Louis Rossmann, who does a lot of right to repair advocacy, among other things.


"Grayjay combines video content from multiple platforms, such as YouTube, PeerTube, Twitch, and others, into one app, removing the need to switch between different platforms."


Aside from vaguely implying it’s some kind of media player that plays content from the internet, that doesn’t tell a whole lot.

Some screenshots would be a nice addition to their page.


There are a bunch of screenshots on the linked page, you might have a plugin that is interfering with the content if you don't see them.


Screenshots disappear for some reason on mobile. Home page has screenshots but only of the mobile app.


I wonder why the article doesn't mention utilizing the browser cache for your static CSS and JS assets instead of introducing a service worker as first measure.

Few years ago I built a shopping site MPA this way and the page transitions were almost not noticable.


Especially since the `stale-while-revalidate` and `immutable` Cache-Control directives are well supported nowadays.

Stale-while-revalidate: see https://web.dev/articles/stale-while-revalidate & https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Ca...

Immutable: https://datatracker.ietf.org/doc/html/rfc8246 & https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Ca...

And if using a CDN, `s-maxage` (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Ca...) is quite useful. Set it to a long time, and purge the CDN cache on deploy.


  Immutable
is what you need. Crazy enough, Chrome has not implemented it. Bug open since 2016: https://issues.chromium.org/issues/41253661

------------------

EDIT: appears that Chrome suddenly had decided in 2017 to not validate at all on reload anymore, after Facebook had complained to Chrome devs about Chrome being more a drag on their servers compared to other browsers.


To be fair, it’s because Chrome handling of a soft reload is different from Firefox or Safari, and does not lead to revalidating (let alone refetching) assets files. See https://blog.chromium.org/2017/01/reload-reloaded-faster-and...

Quoting https://engineering.fb.com/2017/01/26/web/this-browser-tweak...:

> We began to discuss changing the behavior of the reload button with the Chrome team. […] we proposed a compromise where resources with a long max-age would never get revalidated, but that for resources with a shorter max-age the old behavior would apply. The Chrome team thought about this and decided to apply the change for all cached resources, not just the long-lived ones.

> Firefox was quick in implementing the cache-control: immutable change and rolled it out just around when Chrome was fully launching their final fixes to reload.

> Chrome and Firefox’s measures have effectively eliminated revalidation requests to us from modern version of those browsers.


I just wrote my edit before I saw yours. Must have been a cache problem :)


“There are only two hard things in Computer Science: cache invalidation and naming things.” — Phil Karlton (cf. https://www.Karlton.org/2017/12/naming-things-hard/ or https://MartinFowler.com/bliki/TwoHardThings.html)

;-)


And off by one errors


That's a nice addendum to the quote, actually. Will use it in future.

> There are only two hard things in computer science: Cache invalidation, naming things and off-by-one errors


And dates and times And currency


Manage date and time in UTC/Zulu. Append the time zone if that meta is needed and store both the client and server for backend. That way you don't have to deal with time travel and can handle time shifts.

I would say that concurrency is a caching issue once proper locking has been set.


And ce conditions rainduced by concurrency.


Same (but not a shopping site). Bundle the JS and CSS into one file each and cache it forever (hash in the filename to bust the cache). Then with each page transition there's exactly one HTTP request to fetch a small amount of HTML and it's done. So fast and simple.


+ you need to pair that with immutable, otherwise you are still sending validation requests each reload time, so you are doing more than one HTTP request.


This has been the common/best practice for so long I don't understand why TFA is proposing something different.


Cache control directives indicate how long a browser, proxy etc can store a resource for… they don’t guarantee they will store it for that long though

Control over Service Workers cache lifetime is more explicit

I’d still specify ‘good’ cache lifetimes though


Makes sense as a theoretical problem. Have you ever seen data that suggests it's a practical problem? Seems like one could identify "should be cached forever but wasn't" using etag data in logs.


Facebook did a study about ten years or so back where they placed an image in the browser cache and then they checked how long it was available for… for something like 50% of users it had been evicted within 12hrs

If one of the most popular sites on the web couldn’t keep a resource in cache for long then most other sites have no hope, and that’s before we consider that more people are on mobile these days and so have smaller browser caches than on desktop


From the discussion above it seems that browsers have changed their behaviour in the last 10 years based on that study.

See: https://news.ycombinator.com/item?id=42166914


Browsers have finite cache sizes… once they’re full the only way to make space to cache more is to evict something even if that entry is marked as immutable or cacheable for ten years


Exactly this. In our case we went so far to cache all static assets. Putting them into a directory with a hash in the name made them still easy to bust.

  # Cache static files
  location ~* \.(ico|css|js|gif|jpe?g|png|svg|woff|woff2)$ {
    expires 365d;
    add_header Pragma public;
    add_header Cache-Control "public";
    proxy_pass http://127.0.0.1:9000;
  }


On a session basis browser caches are effective but on a session to session basis it’s likely the content will get evicted as resources from other sites gets cached - there’s an oldish Facebook study where they placed an image in the cache and after 12hrs it had been evicted for 50% of visitors

Service Workers offer more controls over cache lifetime, and in Chromium (at least) JS gets stored in an intermediate form (which reduces the re-compile overhead on reuse)


Edit: below isn’t true. You could set immutable in cache header and the browser wouldn’t verify.

—— Original comment:

With browser cache, the browser stills need to send a HEAD request to see if the content was modified. These requests are noticeable when networks are spotty (train, weak mobile signals…)

Service Worker could cache the request and skip the head requests all together


Set max-age in the Cache-Control header to a high value and the browser will not need to revalidate. When deploying a new version, "invalidate" the browser cache by using a different filename.


Or keep the file name and send the file with a query string of some changed numeric value


Not if you tell the browser it's guaranteed fresh for 10 minutes and then use cache-busting in the URL


Oh yeah. The immutable tag right? Total forgot about that


Well that would just make it too simple and not blog-worthy.


Because cache invalidation is one of the two hardest problems in computer science.


I was just wondering the same. Browser cache is is old and effective, but unfortunately nobody cares nowadays.


People care when the browser cache is holding on to something - "try clearing your cache" is still a very common tech support solution.


As tmux can be extended with plugins I'd recommend to check through this list and see if you find something useful:

https://github.com/tmux-plugins/list

As a neovim user I can also very much recommend this vim plugin to seamlessly navigate between tmux panes and neovim windows:

https://github.com/christoomey/vim-tmux-navigator


This is a killer feature IMO. Bind the ctrl-hjkl in vim/neovim for navigation and go between vim panes and tmux panes transparently, beautiful.


Even if it's obvious: I was missing a "How to use" section in the README that demonstrates how this tool can be invoked.

EDIT: Ok, there's something in the "Working with STDIN and STDOUT" section. But TBH I'd find it more helpful to have the different use cases collected at the top. To me it wasn't even clear how the command is called.


I would love to see better performance with triggers. Even on an M1 Pro Max when I have triggers I get a slightly noticeable lag. It could just be me though. I run at 5k resolution with a lot of text.


Are triggers a tailspin feature, or are you referring to iTerm triggers which are mentioned elsewhere in this thread?


Thanks for the feedback! Good idea to showcase the use cases earlier and clearer.


Hmm, he lost me on page nine where "complete" is explained.

> Complete means that every sequence of vectors |a1>, |a2>, ... satisfying lim ...

How are the elements of this sequence related? And why are we only interested in the elements where the index n/m goes to infinity? What does that even mean if the sequence is arbitrary?

That's probably why I also can't make sense of this:

> Loosely speaking, saying that a Hilbert space is complete means that it contains all of its limits.


This is standard mathematical analysis. Infinite sequence of elements may look like it converges to some target element, judging by mutual distances converging to zero. Such sequence is a Cauchy sequence. When the target element actually exists, then the sequence is also convergent. A space where every Cauchy sequence is convergent, is called complete.

Example: if the space is all real numbers except 0, then any sequence of real numbers accumulating around 0 (for howsoever small a distance, there is always infinite number of points closer to 0), the sequence is a Cauchy sequence, but not convergent (because 0 is not present). So that space is not complete (has a hole).

If the space is all real numbers, then the same sequence is also convergent, and the space is complete (no holes).


It helped me to look up an example of a space that is not "complete".

Turns out, rational numbers are the classic example of a space that is not complete. A sequence of rational numbers can approximate pi but pi itself doesn't exist in the space (since its irrational). So the rational numbers that get closer and closer to pi form a limit to a value that's not in the space.


That's a great example. To make it concrete, you can take the sequence such that $a_n$ is the $n$-th partial sum of any of the series here that involve only rational numbers: https://en.wikipedia.org/wiki/List_of_formulae_involving_%CF... multiplied by an appropriate constant.


Agreed that this is pretty terse. The sequences they're talking about are called Cauchy sequences [0]. A sequence a_i is Cauchy if for any epsilon, there exists an N such that if m and n are both greater than N, then |a_m - a_n| < epsilon. A classic example, suppose your space is the set of rational numbers, and consider the sequence a0 = 1, a_1 = 1.4, a_2 = 1.41, ... a_n = sqrt(2) up to n digits after the decimal place. You can verify that this is a Cauchy sequence, successive points get arbitrarily close to each other. This means the rational numbers are incomplete, because this Cauchy sequence of rationals doesn't converge to a rational number. It's the real numbers that forms a complete space.

Completeness is required for nice results like the spectral theorem for self-adjoint operators [1] to hold, which is pretty essential for Quantum Mechanics.

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

[1] https://en.wikipedia.org/wiki/Spectral_theorem


> How are the elements of this sequence related

They are not necessarily related

> And why are we only interested in the elements where the index n/m goes to infinity?

If the sequence is finite, then we don’t really care to discuss the “limit” of the sequence.

> Loosely speaking, saying that a Hilbert space is complete means that it contains all of its limits.

For a set S to not contain all of its limits means you can have an infinite sequence of points (a_n) where each a_n is in S and there is no point a in S so that the sequence is eventually as close to a as you’d like.

More formally, there does not exist a in S so that for any e > 0 we can pick an M so that m > M implies | a_m - a | < e.

You can see how “m > M” gives a formal meaning to “eventually,” and “for any e > 0 … | a_m - a | < e” gives a formal meaning to “as close to a as you’d like.”


Imagine a continuous space without holes in them (no holes at all, not even tiny ones).


Putting that into plain English, "If it looks like a sequence is converging, it really is converging to something."

What does it mean to say that the sequence looks like it is converging?

Naively, it means that any two elements far in the sequence are always very close together. We make that intuition more precise by turning it into a challenge-response, "You tell me how close you want the elements to be, I'll tell you how far out to pick your elements." And then we write that mathematically as

    ∀ ϵ > 0                           # You tell me how close
      ∃ N                             # I'll tell you how far
        such that if N < n, m         # so that any 2 elements
           then || a_n - a_m || < ϵ   # will always be that close
Others have given examples about things like the rational numbers. The canonical example of why it matters comes from Fourier series. Joseph Fourier discovered this one. Consider a bunch of functions f(x) over the interval from 0 to 2π. We can create a dot product with f·g equaling the integral from 0 to 2π of f(x)g(x). And the length of a function f is sqrt(f·f)

Joseph Fourier discovered that the following functions are orthonormal (each has length 1, their dot product with each other is 0).

    1/sqrt(2π),
    sin(x)/sqrt(π), sin(2x)/sqrt(π), sin(3x)/sqrt(π), ...
    cos(x)/sqrt(π), cos(2x)/sqrt(π), cos(3x)/sqrt(π), ...
(I hope I have the constants correct...)

Given any function, he could compute a series that we now call the Fourier series that looks like it added up to that function. But there were complications. It added up perfectly for smooth functions with the same value at the edges like x(2π-x). But it also added up except at a few points for things like square waves. This caused a crisis in mathematics because at the time square waves were not considered functions, and nobody had ever realized that adding up infinite series of smooth functions could do such weird things. Their idea of functions was essentially what we would call analytic functions today. Basically things that look like power series. And Mr. Fourier had just shown that the analytic functions are not complete.

In addition to revealing problems in how we understood math, his technique was very, very useful. Because now you just had to figure out the physics of how, say, heat spreads out or vibrating strings vibrate just for those those sin and cos terms, and then you could figure out heat and vibration for ANY function.

Resolving the math problems started many decades of research. The results of which included better definitions of the real numbers, the ϵ-δ definition of a limit (or ϵ-N for a series), new theories of integration, and the idea of Hilbert spaces.


> We then ask the primary database for a snapshot, a list of all past primary database transactions whose effects are visible to our new transaction.

I wonder what happens for records with many changes during their lifetime. Wouldn't the size of such a snapshot grow infinetely for them?


Title is missing "(2003)".


This looks really nice but I'm missing specs on the format of the input data.


tsv files, tab separated values. From the usage section:

  uplot <command> [options] data.tsv
https://github.com/red-data-tools/YouPlot#usage


If you already know a programming language and prefer a more concise tutorial you might also like this site:

https://cplusplus.com/doc/tutorial/

It's way less verbose and more to the point.


You should absolutely not use or recommend that site. It's stuck on incomplete C++14 at best and also contains some pretty bad code. learncpp.com is a much better tutorial and cppreference.com is a much better reference. The only thing cplusplus.com is good at is polluting search results.


Back when I was a software engineer, I used to constantly hear how bad cplusplus was. Yet, in spite of this, I'd fairly often find myself using it because the results were just so much easier to parse.

Just as an example, cppreference doesn't have a page dedicated to std::string (when you search for it on Google, it tkes you to std::basic_string) whereas cplusplus does.

Even comparing the two pages, cplusplus immediately gets to the point that std::string is just a std::basic_string<char>, whereas cppreference has three paragraphs of technical minutiae before it finally points out what std::string is.

Even though cplusplus is out of date and incomplete, it's still often more useful than cppreference when you're trying to get your head around STL for the first time.


cppreference has a steep learning curve with how information dense it looks, but once you’re up to speed you can move a lot faster with the standard library. I find it’s the site I always have a tab open on.


I haven't done any C++ since 2015ish but your link seems incredibly outdated.

Sure you'll learn some C++ syntax, but you'll learn the C++ from 20 years ago, not the modern C++ with smart pointers and all that stuff which is basically turning it into a new language.


Is it a bad idea to learn from Stroustrup's 'Principles'?


No, it is a great book to get started with C++ if you already know programming.

Relevant: https://news.ycombinator.com/item?id=34233688


as someone that has done a lot of commercial C++ teaching in his time, i would say that this is one to avoid for a beginning programmer. stroustrup is not, imho, one of the worlds great teachers, and i would not recommend C++ as a first programming language. more experienced programmers should go with TC++PL.


Interesting. I'm sort-of experienced (never pro, but lots of little projects in JS & Python. I got Principles to try and fill in gaps in my basic knowledge & so far it seems like it has been helping. I'm a little over halfway through. What else would you reccommend?


josuttis's books on the standard library and templates are very good


Or in even more concise way here: https://learnxinyminutes.com/docs/c++/


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

Search: