HNHacker News
TopNewBestAskShowJobs

sfilipov

229 karma · joined July 3, 2014

GitHub: github.com/sfilipov

LinkedIn: linkedin.com/in/sfilipov

submissionscomments
sfilipov··on Consistent Hash Ring
Worth mentioning that virtual nodes also ensure that the order of servers is random. Which helps when a server is removed - the keys that need to be moved will be spread across all other servers. If we were to evenly chop up the hash ring, server B will always be after server A. And when we remove server A, all keys residing on it will need to be moved exclusively to server B.
sfilipov··on You might not need an effect
I am not sure I understand your confusion but here's a few pointers in no particular order:

- the argument passed to useState is initial state, not "forever state". It will seed prevItems for the first render. But later when items prop changes, it's on you to detect the change to what you have as prevItems so far and call setPrevItems yourself.

- items is coming as a prop from outside, prevItems is whatever you set it to last time using setPrevItems

- calling a state setter (setPrevItems / setSelection etc) will always cause a rerender. That's why if you don't have the if condition you have just created an infinite loop - you are inside a render, and if you unconditionally call setX that causes another rerender later etc etc

- that's why I am not a big fan of this particular "Better" example and prefer the later "Best". Avoiding calling state setter function from inside render will make your life easier.

sfilipov··on USV Dumps 100% of Coinbase Stock
You could argue investing in Coinbase had lower risk than investing in Bitcoin directly (was it?). Then the risk adjusted return would be even better.
sfilipov··on Valve accused of ignoring existing RCE vulnerability in Source games for 2 years
Exactly! I get blamed for cheating and reported (trust me I don't) so I whenever I play matchmaking I'm also in the "likely cheater" group. That's why I play on third party server with their own anti cheat system.
sfilipov··on Hasura raises $9.9M to simplify GraphQL
> A huge benefit that tools like Hasura, Postgraphile and PostgREST provide is using the native in-database row level security model.

I agree with your overall comment. Note that Hasura doesn't use the native row level security in Postgres. They implement the layer themselves. There are two reasons: 1) Hasura is older than the first release of Postgres that included the row level security feature. 2) Their implementation scales better when there are a lot of users subscribed to the same GQL Subscription. When using row level security, every user's query result looks different, so they need to create a database subscription / polling for each user GQL Subscription. Their implementation allows them to have a single PG subscription (well they mostly do polling), get all the data back, then strip down on the way out to the GQL subscribers.

sfilipov··on Ask HN: How do you learn complex, dense technical information?
One way I try to combat that is by forcing myself to do things the simplest way (unless I am aware I'm making a technical decision I can't change later). Then I try to add more complex bits when necessary. As a bonus you learn the skill of "refactoring" etc.

For example, nobody is forcing me to use Docker from the start. I don't have to use it until I decide the development or deployment pain is big enough that I will learn how to use Docker. Similarly, why do server side rendering when you can have a perfectly working project without it. Add server side rendering later, when you project actually has real features. Not from day one. The temptation to use cool tech from the start is difficult to ignore at first, but after a few attempts to do a side project, only to give up before you've even started, it gets easier to appreciate stack simplicity :)

Trying to keep code as simple as possible from the start is more difficult, i.e. you might be structuring your code too naively and regret it later when you try to refactor. But as we know, abstracting too early creates similar if not worse problems.

sfilipov··on Hacking GitHub's Auth with Unicode's Turkish Dotless 'I'
> At least the first two of them are type wrappers for strings - opaque to the type checker, but transparent to the runtime. Rust and Haskell have wrappers like this. Typescript does not.

You are right that TypeScript aliases don't work like Haskell ones (which are considered different, and type checked). In TypeScript you can use "branded types" to work around the more loose structural typing:

  type Firstname = string & { readonly brand?: unique symbol }
https://stackoverflow.com/a/51578232
sfilipov··on User Agent Changes
To prevent existing code that relies on it from breaking.
sfilipov··on Today’s correction isn’t much like the dot-com bubble
What are good examples of Reinvest Software? My guess would be Amazon, but what others?
sfilipov··on World of Goo Update, 10 Years Later
Maybe try Dragon, Fly! It is quite similar.
sfilipov··on SQL databases come up with algorithms you’d never have dreamed of (2017) [video]
I don't disagree overall but I'm using SQLAlchemy (Python) on a daily basis and it works quite well.

I agree that if you are building ORM with the intention of hiding so many SQL details that the developers don't need to learn SQL, you'll run into problems.

SQLAlchemy on the other hand starts simple, but is flexible enough that you can do inner/outer joins, you have different loading strategies etc. It is quite nice if you are proficient enough in SQL.

When writing complicated select queries, I'd start by writing the raw SQL then spend my time representing it in SQLAlchemy. It's a bit less than double the work sometimes, but working with the SQLAlchemy objects in Python is quite nice as long as you pull them in an efficient manner. SQLAlchemy just feels like a well thought out ORM.

sfilipov··on Microsoft Announces Windows 10 Pro for Workstations
Tested and it works, as long as you haven't finished downloading and applying the updates.
sfilipov··on Doxing the hero who stopped WannaCry was irresponsible and dumb
Is that going to help against checking with the Internet Archive? I've used the Internet Archive to read versions of reddit comments when they were deleted (but not to dox people).
sfilipov··on Learn Python 3 the Hard Way
Agreed, it's not a problem of theoretical possibility. It's just that the maintainers' time can be better spent improving Python 3 than maintaining a Python 2 compatible runtime.
sfilipov··on New Macbook Pro power efficiency and time remaining
I wonder if all reports of poor battery life are from users of MBP with touch bar. It is interesting that the non-touch bar MBP has a ~10% bigger battery, half the TDP under sustained load and doesn't need to drive the ARM processor + touch bar. Thus better battery life than MBP with touch bar.
sfilipov··on The Dropbox hack is real
You can see all the existing sessions and authorised applications from their website. It is not perfect and it is extra work to go through those and delete them, but at least there is a way.
sfilipov··on [dead]
Previous discussion from 2 months ago:

https://news.ycombinator.com/item?id=11876453

sfilipov··on Ask HN: Where do you host your CV/resume?
You can add to this list websites with programming challenges that also have some form of "candidate profile". HackerRank is one such site.
sfilipov··on Ask HN: How to avoid JS/CSS bloat?
Does that mean that for small personal projects, it is acceptable to include jQuery 2 and Bootstrap everywhere, even if custom JS and CSS are a total of 100 lines of code?

AJAX using jQuery is so convenient. I would rather not write these in vanilla JS.

sfilipov··on Ubuntu 16.04 (Xenial Xerus)
I think your last point is important. I don't think shell script writers should be concerned about Solaris/BSD if they are confident that they will use their scripts only in environments where bash is available.
sfilipov··on GitLab Partners with DigitalOcean to make CI more affordable
I have a question regarding the difference between the "concurrent" and "limit" parameters seen here [1].

I understand that if I'm running a managing runner in machine mode with limit=10 then it can start a maximum of 10 machines. What does "concurrent" affect in this context. I don't want the managing runner to do any builds locally -- just to send to runners managed by machine.

[1] https://gitlab.com/gitlab-org/gitlab-ci-multi-runner/blob/ma...

Edit:

Ignore me. I found the answer on the same page [2]:

[2] https://gitlab.com/gitlab-org/gitlab-ci-multi-runner/blob/ma...

sfilipov··on GitLab Partners with DigitalOcean to make CI more affordable
They should probably rate limit in a sensible way.
sfilipov··on Microsoft and Canonical partner to bring Ubuntu to Windows 10
The only reason I can't really use Windows as development OS are the inferior terminal emulators. As good as ConEmu is, it is still worse than Terminator etc. Unless I can run a native Linux terminal emulator, it doesn't make much of a difference to me. Also, the filesystem differences don't help.

I was also running into Haskell compilation problems that were fixed by running Ubuntu in a Vagrant environment but speed was slow. There isn't good NFS support on Windows either (there is some).

sfilipov··on Stack Overflow: The Hardware – 2016 Edition
64GB is interesting one because it is ~6% of the total data size.
sfilipov··on DNS Outage at DigitalOcean
The answer probably is not very helpful but... change the TTL to a lower value? Is it essential to have such a big TTL of 1 day?
sfilipov··on Why We Chose Kubernetes
If you are using Arch Linux: pacman -S otf-fira-sans
sfilipov··on Beware of hacked ISOs if you downloaded Linux Mint on February 20th
Yes, but why mention MD5 by default? Most machines that have md5sum installed also have sha1sum/sha256sum.
sfilipov··on GitHub responds to Dear GitHub letter
On the plus side, if the manage to fix their problems at some point people will start trusting them to be up. It is not set in stone that they have worse uptime.
sfilipov··on GitHub responds to Dear GitHub letter
They only do Git and have mentioned that currently have no plans to support Mercurial.
sfilipov··on How to be like Steve Ballmer
Who (or what) is ESR?
Page 1 of 4Next →