HN user

jefftchan

1,333 karma

twitter.com/jeffchan

Posts13
Comments33
View on HN
Fenwick Trees 11 years ago

Great post! I found Fenwick trees particularly useful when I was implementing layout / view recycling. The problem is that you need to keep track of a large number of vertically stacked elements with dynamic & varying heights, and you need a way to efficiently get the prefix sum. Would be curious if anyone else has real life use cases of these.

Google Hangouts 11 years ago

Totally agree. See Facebook's messenger.com for a similar thing, done much better.

This is great. Can't wait for the actual release. One question I have is how GraphQL/Relay works for writing/modifying data on the server?

What the Flux? 11 years ago

For me, the part of Flux that's difficult to understand is how server data flows into the cycle (left-hand side of the diagram). The Flux docs only recommends that server interactions should be done from the Action Creators. However, things are actually more complicated than that:

- how do you resolve server / client data conflicts?

- how do stores work with a RESTful API?

- how do you handle network failures, retries, etc?

At Quizlet, we designed a hybrid solution [1] with "syncers" that act as the gateway for network I/O. Syncers are responsible for taking view-level data (ViewModels) and exchanging them with the server (ServerModels). It works well with our REST API. Yahoo has also released their own thing called Fetchr [2] which is more tightly integrated to stores.

I'm curious to see how other people are approaching this problem.

[1] https://news.ycombinator.com/item?id=8954733

[2] https://github.com/yahoo/fetchr

The page width awkwardly jumps when toggling between unified and split diff. Is this a glitch, or intentional?

It's great to see Facebook releasing code for Flux. Hope to see more in the future. Here are some other implementations of Flux for anyone who's interested: https://github.com/BinaryMuse/fluxxor https://github.com/jmreidy/fluxy https://github.com/yahoo/flux-example

We recently adopted this architecture for a medium-scale project. The unidirectional data flow has greatly reduced code complexity for us. We're still not satisfied with our server syncing strategy. Seems like actions are the best place to sync data, but how do you deal with interdependent actions?

At 12 years ago

In China, it's called "circle a" (圈a), "flowery a" (花a), or "little mouse" (小老鼠). In Taiwan, it's most commonly called "little mouse"

Very cool. However, no audio for folks outside U.S. (due to Rdio). Would be nice to have a small warning if this is this case, so users aren't left wondering if something is broken.

Square Market 13 years ago

Took me awhile to figure out this is U.S. only currently. I was confused for ten minutes trying to figure out where the "Add to Cart" option is, until I VPN'd in.