HNHacker News
TopNewBestAskShowJobs

Zalastax

213 karma · joined July 19, 2015

MSc thesis "Singly typed actors in Agda": http://studentarbeten.chalmers.se/publication/256251-singly-typed-actors-in-agda-an-approach-to-distributed-programming-with-dependent-types
submissionscomments
Zalastax··on Remote Code Execution in CouchDB (and Privilege Escalation in the Npm Registry)
Yes, a good point! For interoperability it would be best if everyone followed the ECMA standard for JSON from 2011. It seems like they forgot to even mention duplicate keys in ECMA-404 from 2013 which seems very strange. RFC7159 uses the word SHOULD but I don't think the JSON parser Jiffy has actually understood the full implications and carefully weighed before choosing to allow duplicate elements.
Zalastax··on Remote Code Execution in CouchDB (and Privilege Escalation in the Npm Registry)
He links to a stack overflow question and I think this answer is pretty good https://stackoverflow.com/a/23195243/497116.

https://www.ietf.org/rfc/rfc4627.txt says "The names within an object SHOULD be unique". https://tools.ietf.org/html/rfc7159 is more lax and instead says "An object whose names are all unique is interoperable in the sense that all software implementations receiving that object will agree on the name-value mappings". It's unfortunate that the correct behavior is not agreed on and today we saw the consequences of that.

Zalastax··on Is Haskell the right language for teaching functional programming principles?
As an outsider taking a quick look I found it difficult to navigate. Guided by a course that can be fine, but without that I have no idea where to start. Compare that with the tours of D and go: https://tour.dlang.org/ & https://tour.golang.org
Zalastax··on What happened to distributed programming languages? [video]
The ABS language is another interesting language stuck in academia: http://abs-models.org/documentation/manual/
Zalastax··on Vue.js and Brunch: Webpack Alternative
https://youpic.com/ (press explore) uses React and Redux.
Zalastax··on A better way to represent loading state in ReactJS/Redux apps
Good point! I'm confused by the articles suggestion as it already talks about Flow which has support for string literal types. I.e. undefined | "loading" | "failed" | ActualData
Zalastax··on Show HN: My first native iOS app – Cone, a real time color picker
Super nice! Had I just known about it earlier... We made some different choices, but the end result is quite close. It's a shame that the native html color picker is so bad, I wish I could have used it, but FlexiColorPicker is a delight to work with.
Zalastax··on Show HN: My first native iOS app – Cone, a real time color picker
Cool indeed! I had a similar need and created https://github.com/Zalastax/colornamer. Finding a good source of names was the hardest part so you might want to complement your list of colors with those in my list.
Zalastax··on What I Learned Managing Site Reliability for Some of the Busiest Gambling Sites
Remember that there are different sizes of deployments. For sites like Reddit or Netflix, logs becomes a burden since there's so much data. For smaller deployments it's possible that all logs can be aggregated on a single machine quite easily, and aggregating the logs is far more enjoyable than SSH:ing to each separate machine.

> Sometimes logs can be useful, but only after your monitoring system has told you which system is not behaving, and then you can turn on logs for that system until you've solved the problem, but you shouldn't need access to old logs, because if the problem was only in the past, then it's not really a problem anymore, right?

Some things happen rarely, but can still have large impact. E.g. Imagine a once a day job of moving files which fails twice a month, rendering those files inaccessible.

Zalastax··on Roadmap to becoming a web developer in 2017
It was used to hack together build pipelines since the tools didn't fit together nicely, creating hard to debug messes which we grew tired of. Those hacks can be replaced with webpack and you're often left with a few snippets that fit nicely in the script section of package.json (npm scripts). Gulp is still useful for some projects, but a lot less often.
Zalastax··on RegExr: Learn, Build, and Test RegEx
Complement with https://www.debuggex.com to also get an interactive finite automata (this can really help with understanding what's going on)
Zalastax··on Lossless Web Navigation with Trails
History in browsers and editors should absolutely be a trer so we can do changes without the risk of losing a state we want. If you undo/go back and then make some change it's often impossible to reach back to before the undo. Why is history as a tree not a more common feature?
Zalastax··on Show HN: GitHub trending alternative that ranks repos by contribution rate
Resume gives me a weird feeling because of their "star to use" system. On one hand it prevents abuse, which is fair. On the other it makes you star the project just to try it out, broadcasting to my followers that I used the system, creating an undeserved network effect.
Zalastax··on Crafting a high-performance TV user interface using React
A simple warning: switching to Inferno using inferno-compat can currently give worse performance than react. I tested this recently when Inferno 1 was released and think it's related to https://github.com/infernojs/inferno/issues/548 The techniques outlined by Netflix should apply to users of Preact and Inferno too, so it's still an interesting article.
Zalastax··on Lessons learned as a React contractor
You're completely right! It's unfortunate but the tooling for e2e tests isn't "there" yet. For now the best alternative is Selenium (which I've had a lot of trouble with getting stable) or https://github.com/DevExpress/testcafe
Zalastax··on Lessons learned as a React contractor
I've not written any blog about it but I have it working in a repo [1]. The webpack config and src/model are what's most interesting for you :) To sum it up: combineReducers is templated so make an interface for your state (this is wonderful). HMR works with react-hot-loader 3 and without babel, but the documentation is lacking.

[1]: https://github.com/Zalastax/openschedule

Zalastax··on How to find size of an array in C without sizeof
Computer Science and maths are heavily intertwined [1], just like physics and maths are.

[1]: http://math.stackexchange.com/q/649408

Zalastax··on No tipping means better business
> Usually when we say the LVT doesn't affect incentives, the baseline of comparison is against no land taxes of any form.

That really confused the whole discussion as the current situation is tax on land + improved value, making it look like you were arguing from the other side. No tax at all is anyway taking it to the extreme as the government need money, so it becomes merely an academic exercise.

Zalastax··on A testing system for catching visual regressions in Web applications
I tried to set up a system like this for catching differences between browsers but eventually gave up. I used selenium which didn't work well at all as the browsers constantly lost connection ur hung. I think testcafe [1] looks like a promising alternative. Image diffing is the simplest part but getting consistent images to compare can be tricky. Automatically finding regressions with few false positives ain't easy. [1]: https://github.com/DevExpress/testcafe
Zalastax··on Thoughts on “Dependency hell is NP-complete”
As far as I can tell Nix doesn't do dependency resolution at all [1]. Hard linking every dependency is a solution but is undecireable for most systems. I don't want to specify versions for sub-dependencies so I want them to be automatic and we have the NP-problem again. It might be a smaller set of possibilities if most versions are pinned but it's still NP. [1]: https://medium.com/@charlesstrahan/as-a-nix-nixpkgs-nixos-co...
Zalastax··on Show HN: Antd – A set of high-quality React components
I think the work you are doing right can be a stepping stone for something great! The advantages of more traditional methods of creating CSS are ahead-of-time-compilation, splitting/bundling (combine common chunks to achieve low cache invalidation, low transfer size, and high cache hits with few files), and no waiting for the JS-engine to parse and convert your internal data structure. SPA-SSR is in general a lot more CPU-heavy than the more traditional approach of instantiating templates. We need to find ways of minimising the redundant calculations performed by the server to regain the performance we lost in the transition from templates to SPA-SSR. A source code transformation that extracts CSS and removes static JS is one such step. The SSR API is a good start but completely trashes cache + creates a large .html each time you reload. The .html returned can most often not be cached so we should strive to minimise its size. The problem of caching/minimising server load is not the easiest to solve but we should be long on our way if we can analyse/signal what parts are static and which are dynamic.
Zalastax··on Show HN: Antd – A set of high-quality React components
A big issue I see with CSS-in-JS at this moment is server-side-rendering and caching. You started working on a babel-transform for extracting static styles but seem to have changed your mind about actually extracting that to a css-file[1]. Requiring a JS-parser to apply the styles is the wrong approach but might be a stepping stone as it's probably an easier problem to solve. Separating JS and CSS should improve performance somewhat as the browsers can run the scripting and styling engine separately. In the end I'd like a transformation that creates one CSS-file per JS-file so that common chunks can be combined by webpack, gaining high cache hit percentage on sites that uses reloads. Transformations should also be applied to the JS so that SSR doesn't have to calculate styles each time.

[1]: https://github.com/styled-components/styled-components/issue...

Zalastax··on Regex 101
Complement with https://www.debuggex.com to also get an interactive finite automata (this can really help with understanding what's going on)
Zalastax··on Show HN: I invented a caffeinated toothpaste
Are you sure that glycerin prevents remineralization? Dr. Schau[1] thinks it's unfounded.

[1] http://www.myfamilydentist.ca/glycerin-and-remineralization-...

Zalastax··on Currying in JavaScript
I had a function taking parameters and wanted a function without parameters. Using this style the function would be called immediately when all parameters are supplied, instead of in the callback as I intended.
Zalastax··on Currying in JavaScript
In what way is it better than partial() from rambda or underscore? I have tried to see the potential in currying but gave up when I couldn't create a function with no parameters without calling it.
← PreviousPage 4 of 4