HNHacker News
TopNewBestAskShowJobs

javitury

314 karma · joined May 26, 2016

submissionscomments
javitury··on Notes on structured concurrency, or: Go statement considered harmful (2018)
What about async/await?

It seems to be a safe pattern under the criteria stated in the article as long as all async calls are awaited. This pattern guarantees the flow will return back only after all async task have finished.

The article says modern languages allow domesticated forms of goto (statements like break, continue, return...) that are scoped at function level. What about exceptions and exception handling? An exception thrown in a function and caught in a parent works as a wild goto. The railway pattern comes to my mind.

javitury··on Thunderbird’s New Home (2020)
I also love and hate Thunderbird. Feature-wise it's king but the biggest pain for me is lost folders. It happens once every couple of years but it's very frustrating, especially if the lost local folder is the only archive left from an old email account.

What I've learned is that the mbox format used by Thunderbird is not reliable for long term email storage. If something seems wrong with a mailbox in Thunderbird (e.g. a few lost or corrupted emails), do NOT compact it, or you will lose your email forever.

The alternative storage format, maildir, is in my experience much more reliable. I've used maildir and TUI email clients for 7 years without incidents, the only downside is the steep learning curve. Thunderbird has support for maildir but it's still experimental and I wouldn't advice anyone using Thunderbird+maildir for storing emails long term.

javitury··on Ask HN: Why is Firefox losing marketshare and how would you save it?
What do you think of Mozilla Developer Network (MDN) or Rust? Do you think they were a mistake?
javitury··on Why Galesburg has no money
> As a town we are essentially a fixed plot of land cultivating a crop of buildings which we tax to fund our corporation

This is a very interesting point of view that I have not seen anywhere else. However it omits side-effects that buildings have on citizens other than taxes, e.g. hospitals improve health, universities improve human capital of citizens, factories create network effects with respect to suppliers and retailers, etc. A healthier and more educated workforce will be more productive and a healthier business network will add more value generating more sales taxes and increasing property value.

javitury··on Poll: Why are people leaving their jobs?
It was one of my favorite classes too!

I remember that BATNA (best alternative to a negotiated agreement) was the most important factor (but the least interesting, it can't be improved as a skill). If the figures of employees switching jobs are as high as they say, that means either lots of impossible negotiations (misfits) or lots of negotiation failures.

javitury··on Apple said to be preparing for iPhones without SIM card slot in 2022
I don't have an iphone but I side with apple this time.

Using credentials(esim) for accessing phone networks looks much easier and practical than physical tokens. No need to wait 2 weeks to switch companies. No need to check if your phone supports dual sims, and which slot is the one with 4G/5G. Security won't be worse, remeber that sim swapping already exist.

It's a win for consumers. Would anyone use a physical token to access a wifi network? Even corporate wifi networks use credentials or digital certificates.

javitury··on Solidjs – JavaScript UI Library
Yes, by getters I was trying to refer to these wrappers.

  const valueGetter = () => props.value;
javitury··on Solidjs – JavaScript UI Library
Properties are proxies, but getters should be used for everything else. Why weren't getters also used for properties?
javitury··on Prospectus (1843)
https://web.archive.org/web/20211027154009/https://www.econo...
javitury··on Prospectus (1843)
The outline page only says "None", it doesn't have any article.
javitury··on Gender in Latin and Beyond: A Philologist’s Take
> In the fifth declension, the only word inherited as masculine is dies, “day” [...] Eventually, the feminine gender prevailed, and all Romance reflexes of dies are feminine.

What about "un día" or "el día" in Spanish?

javitury··on Google, Mozilla Close to Finalizing Sanitizer API for Chrome and Firefox Browse
That uncertainty is still a blocker for many apps.
javitury··on SpiceDB Is Open Source
How can one maintain in sync the application database with the permissions database?. Suppose there is a project which uses a postgres database and a spiceDB (backed by a separate database).

This project is a "github clone" and a user has decided to delete a repository with all of its related objects. In postgres these related objects delete automatically in cascade. How can I do the same in SpiceDB to avoid leaving garbage tuples behind?

javitury··on What's New in React 18?
Webcomponents are a huge mess, caused partially because it requires to do (some) composition in html. React is much simpler, it uses basic html elements (div, input, ...) and event apis to compose an application in javascript.

These are some disadvantages of webcomponents that I can think of.

- Can't register multiple versions of a webcomponent. Let's say you are using "x-dropdown"@2.0.0 which depends on " x-icon"@2.0.0 and "x-menu"@3.0.0 which depends on " x-icon"@1.0.0. Your app will crash because html tags can't have multiple versions ("x-icon" 2.0.0 and 1.0.0). It makes handling big projects a nightmare. And there are name collisions too.

- Not all properties can be serialized into attributes as strings, so you end up just binding properties. Boolean attributes have special are weird when used in the javascript side (an empty string is treated as a boolean)

- The shadow dom can be too restrictive and inflexible. Implementing portals for instance, requires using ugly hacks that depend on your webcomponent framework.

- Some complex webcomponents are not interoperable among different frameworks.

- Static analysis on webcomponents is poor and fragile. Compare declaring types of events in webcomponents, to declaring types of event handlers in react.

javitury··on List of all the projects Killed by Google
Should also include

  - Polymer 1

  - Polymer 2 (not backwards compatible)

  - Polymer 3 (not backwards compatible)
And maybe Lit-Element if you consider it was replaced by "Lit"
javitury··on Deep reinforcement learning is a waste of time (2019)
> anyone has looked into using genetic algorithms combined with RL where the genetics determine the reward function

There is an introductory guide to rust, deep learning and genetic algorithms that I really like, it's called "Learning to fly" [^0]

[0]: https://pwy.io/en/posts/learning-to-fly-pt1/

javitury··on Ethereum will use around 99.95% less energy post merge
> On the other hand, any exchange that automatically opts user deposits into staking without notifying them should be criminally liable.

One of the selling points of cryptocurrencies is that they make financial transactions and contracts possible without depending on a central authority.

javitury··on Ergodicity, What's It Mean
Try these parameters

n_subjects = 1000

n_trials = 100

javitury··on Attention Is Not a Resource
Apart from his reflections and the way the are presented, I also liked the audio accompanying the article.

For me, a non-native speaker, it makes the article more enjoyable. It's like restoring the appropriate colors of a previously desaturated picture. The only thing I missed was a floating media control widget, so I could pause the audio and give myself some time to think.

javitury··on Git email flow vs. GitHub flow
Reading this article has changed the impression I had about git-mail-flow. Naturally, more questions came to my mind.

Is a git-mail-flow compatible with continuous integration? Yes, it seems to be

https://sourcehut.org/blog/2020-07-14-setting-up-ci-for-mail...

Is it possible to construct ergonomic workflows around a git-mail-flow? I suspect you could do it with notmuch and alot, although I wonder which tools do sourcehut users prefer.

javitury··on The Ergodicity Problem in Economics
Thanks for sharing the economics' reply, I found it very interesting. All the good stuff is in the supplement.

They argue that Peters' model produces extreme risk aversion in lotteries with (near) zero payoffs, and such risk aversion is not backed by empirical work or even by intuition.

"Would a person ever prefer a process [A] that, after three rounds, diminishes wealth from US$10,000 to 0.5 cents over one [B] that yields a 99.9% chance of US$10,000,000 and otherwise US$0? Ergodic theory predicts [A] [... but] [v]irtually everyone will prefer B"

That is, growth models don't behave well at or near zero.

Personally, I enjoyed reading Peters solution to the St. Petersburg paradox and how the ergodicity framework is applied to economics in such a concise and intuitive manner.

But I am reluctant to think that this ergodicity framework will completely remove the "psychological" aspects of economics. The utility of agents still needs to be accounted for. The ensembles that Peters describes are heterogeneous, and agents can derive different amounts of utility even if wealth or growth rates are equal. Think about insurance.

javitury··on A Vim Guide for Advanced Users
Those commands may look useless at first sight, but combined can create powerful routines. As an example, my routine to refactor non-typesafe codebases.

- Find the pattern that you want to replace (the last dot is for current dir)

:grep -r 'pattern' .

- Open the quickfix window and check if matches are correct

:copen

- Find and replace the entries of the quickfix list

:cdo s/pattern/replacement/ | update

javitury··on Why it’s usually crazier than you expect
Price is a function of supply and demand. Shorting 140% of the stock increases supply by 140% and demand by 140%. It looks balanced, but there is an asymmetry in terms of pressure to close positions.

Those shorting shares have to pay interest, place collateral if price goes up and need to buy back those shares regardless of market price. The ones holding shares don't have that pressure and their losses are bounded.

If options are used, the effect depends on how the price of the underlying moves. Generally they just have a multiplicative effect, the losing side has to increase collateral.

A particularity of shorted calls is that losses are unbounded.

javitury··on Siuba – A Dplyr Port to Python
Dplyr and data.table are two libraries that make R shine in terms of data manipulation.

Python however has static analysis tools that are unavailable in R. I wonder if there is a data manipulation library in python that takes advantage of this. Looking at this library, it doesn't appear to use type hints. Other libraries, like pandas, have some basic support for typings but they are still far from being fully typed.

javitury··on GitHub Releases Dark Mode
It's interesting to see how they did it and pros/cons of their approach. In general the page look like it's built server-side. Some parts use lit-html but they are just a few and I believe they are not using webcomponents or shadowRoot.

Custom css properties are used to personalize colors, which would also work with shadowDom.

background-color: var(--color-menu-bg-active);

These custom properties are declared in light.scss and applied to the body, using the selector [data-color-mode="light"].

This method is fairly standard and widely used in modern websites. The only downside is that IE11 doesn't support custom properties and, in my expierience, there is no polyfill or postcss plugin that is 100% reliable.

javitury··on Once the disease of gluttonous aristocrats, gout is now tormenting the masses
A quick search on the internet shows the opposite. Most popular legumes don't have high levels of purines despite having high protein levels.

Also "higher total dietary protein intake from mainly poultry and fish/shellfish was associated with an increased risk of gout, while dietary intake of soy and nonsoy legumes was associated with a reduced risk of gout."

https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4939435/

javitury··on Over 80% of Covid-19 patients in a hospital study have Vitamin D deficiency
That's a good point. The association between vitamine D and coronavirus could be hidding a confounding variable: time spent indoors. Spending time indoors increases the risk of contagion and viral load. Also it's correlated with lower sun exposure and lower vitamine D levels.
javitury··on Porn, Zen, and .vimrc
Coc.nvim provides VSCode equivalent plugins in vim.
javitury··on Everyone’s a Day Trader Now
Fees and spreads from overtrading will eat up that money first.

If the market tanks for a long time, that's a big problem for everyone (directly or indirectly).

javitury··on Show HN: Runnaroo – A new search engine
Runnaroo has become my default search engine since a couple of months.

1. Search results are more relevant. In comparison to google. I noticed a reduction in spammy results like slant, fake blogs, gitmemory, etc. There is still room for improvement.

2. Claims to respect users' privacy

3. Languages other than English are handled fine. In this regard runnaroo is usable for everyday searches, unlike DDG. Queries in a foreign language produce results of the same or lower quality than those from google.

I know the author is reading this, so here is some feedback.

- Make the search engine available for firefox mobile. I know there is an extension but it can't be installed on phones.

- Improve the behavior of the search box in mobile phones.

- Keep on fighting spammy results

← PreviousPage 2 of 5Next →