Better HN
topnewbestaskshowjobs
Log inSign up

sfilipov

229 karma · joined Jul 3, 2014 (12y ago) · 110 submissions

GitHub: github.com/sfilipov

LinkedIn: linkedin.com/in/sfilipov

Submissions

comment 1y ago · link · parent

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.

comment 3y ago · link · parent

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.

comment 5y ago · link · parent

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.

comment 5y ago · link · parent

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.

comment 6y ago · link · parent

> 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.

comment 6y ago · link · parent

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.

comment 6y ago · link · parent

> 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

comment 6y ago · link · parent

To prevent existing code that relies on it from breaking.

comment 7y ago · link · parent

What are good examples of Reinvest Software? My guess would be Amazon, but what others?

comment 7y ago · link · parent

Maybe try Dragon, Fly! It is quite similar.

comment 7y ago · link · parent

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.

comment 9y ago · link · parent

Tested and it works, as long as you haven't finished downloading and applying the updates.

comment 9y ago · link · parent

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).

14.

How to Succeed at Recursion Without Really Recursing(mvanier.livejournal.com ↗)

2 points · by sfilipov · 9y ago · discuss

comment 9y ago · link · parent

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.

comment 9y ago · link · parent

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.

comment 10y ago · link · parent

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.

comment 10y ago · link · parent

Previous discussion from 2 months ago:

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

comment 10y ago · link · parent

You can add to this list websites with programming challenges that also have some form of "candidate profile". HackerRank is one such site.

comment 10y ago · link · parent

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.

21.

Ask HN: How to avoid JS/CSS bloat?

4 points · by sfilipov · 10y ago · 5 comments

comment 10y ago · link · parent

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.

comment 10y ago · link · parent

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...

comment 10y ago · link · parent

They should probably rate limit in a sensible way.

comment 10y ago · link · parent

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).

comment 10y ago · link · parent

64GB is interesting one because it is ~6% of the total data size.

comment 10y ago · link · parent

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?

28.

Microsoft Extends Skylake Support on Windows 7 and Windows 8.1(anandtech.com ↗)

2 points · by sfilipov · 10y ago · discuss

29.

OWC Introduces SSD Upgrade for MacBook Pro and MacBook Air PCIe SSDs(anandtech.com ↗)

1 points · by sfilipov · 10y ago · discuss

comment 10y ago · link · parent

If you are using Arch Linux: pacman -S otf-fira-sans
1234