HNHacker News
TopNewBestAskShowJobs

jarek-foksa

1,958 karma · joined April 19, 2011

I'm the developer of boxy-svg.com and xel-toolkit.org.
submissionscomments
jarek-foksa··on The state of Web Components
None of the frameworks you have mentioned support proper sandboxing of component internals. They are leaky [1] and incompatible with each other abstractions. We need at least some basic native shadow DOM support in order to hide implementation details and avoid naming clashes.

[1] https://en.wikipedia.org/wiki/Leaky_abstraction

jarek-foksa··on Running a Dark Web pedophile honeypot
Evil and good are not real things, those are abstract, subjective and high level concepts that exist only in our brains. You can easily reprogram a human ("teach" or "brainwash" using the subjective terms) to classify death, slavery and misery as either good or evil.

All that matters in nature is whether something works or does not work, not whether it's good or evil.

jarek-foksa··on Metaprogramming in ES6: Symbols and why they're awesome
Why window.Symbol looks like a constructor, but works like a factory? Wouldn't it make more sense to have either a regular constructor (let symbol = new Symbol()) or a regular factory (let symbol = createSymbol())? If it looks like a duck, it should also walk like one.

When subclassing, what is the advantage of [Symbol.toStringTag] getter over the toString() method override? Is it just another way to do the same thing?

jarek-foksa··on Germany passes Japan to have world's lowest birth rate
Those who remember famine and war are usually past their reproductive age. The young people take it for granted that they will live until their eighties, even on their low paying jobs.

If poverty was causing reduced birth rate, we should have gone extinct long time ago. I suspect though that increased competition for non-essential resources and territory (like a new car or a house) might somehow turn off our reproductive instincts because in the past this was usually a prelude to self-destructive competition for essential goods.

I'm not encouraging or discouraging anything, I just don't see the problem. Everything seems to work according to the nature. The only thing that needs adjusting is the social security system which is based on the flawed assumption of infinite population growth.

jarek-foksa··on Germany passes Japan to have world's lowest birth rate
Are they worried about being killed by famine (after having eaten their own cats and dogs), war or pandemic soon? If not, then they are not "struggling to live", which in turn means there is no need to reproduce that much.

From the biological perspective, excessive population growth can be dangerous to the species [1].

[1] http://en.wikipedia.org/wiki/Behavioral_sink

jarek-foksa··on Why We Need a ViewBox Property in CSS
The only purpose of the viewBox attribute is to define a rectangular area in the abstract coordinate system.

How that area will be fit into the viewport is determined by the "preserveAspectRatio" attribute.

If you don't define any viewBox then there will be no scaling - 1px in the viewport coordinate system will be mapped to 1 user unit in the abstract initial user coordinate system.

jarek-foksa··on Improve your touch typing
Type Fu [1] uses this approach. You can choose between random words or random letters. The first level starts with letters or words that can be typed with the home row keys and each subsequent level adds more keys. The levels are optimised for Qwerty, Colemak and Dvorak layouts.

[1] http://type-fu.com/

jarek-foksa··on Estonia e-residency application now online
If you and your small business are based in the US then you could ignore the VAT nonsense when selling to the customers from the EU [1]. It's not in the interest of the IRS to make you pay taxes in Europe.

[1] http://www.happybootstrapper.com/2014/im-us-whatll-happen-ju...

jarek-foksa··on The Dawn of AI: How to ensure the promise outweighs the perils
I would expect the first AI to improve itself (or produce a new AI) in a controlled and planned manner (from the perspective of that AI, not the humans). Intelligence explosion would look like an instant revolution to humans, but from the perspective of the AI it would be a lengthy evolution process.

The second AI created by humans is unlikely to have same goals or to be predictable by the first AI (or whatever evolves from it), thus I guess it's something that the first AI would want to prevent, either by eliminating humans or by fully controlling them (for their own good).

It's extremely important that the first AI we create is well thought out as we won't have the second chance to fix things up, once it's here it will have god-like powers over us.

jarek-foksa··on The Dawn of AI: How to ensure the promise outweighs the perils
If we managed to create an AI that gets out of control, we would pose an existential threat to it due to our ability to create another even more powerful and uncontrollable AI.
jarek-foksa··on Fixing Italy, a little bit at a time
The directors are fully liable if their actions are found to be fraudulent. It's "limited liability", not "no liability whatsoever".
jarek-foksa··on Fixing Italy, a little bit at a time
Keywords: tax residence, controlled foreign company.

To be more specific, such structure would not be illegal, but you would have to deal with double the amount of bureaucracy and you would pay the same taxes.

jarek-foksa··on Fixing Italy, a little bit at a time
As far as I know there is no European country that would have legal structure similar to LLC in the US.

If you want to avoid double taxation while maintaining limited liability, you have to get into some complex and obscure legal structures - like a limited partnership where one partner is a limited company (with at least two directors) and the another partner is you.

Even then, the limited liability is very limited and it's easy to make a mistake that will make you fully liable.

jarek-foksa··on Inkscape 0.91 release
I don't understand how DPI is relevant here, if an authoring tool takes into account DPI when translating user units to viewport units then it's a bug in the authoring tool rather than limitation of the SVG format.

Not sure if this is what you meant, but some tiny rounding errors might occur during conversion if there are many transforms involved between the user space and the viewport space, but this can be avoided if user space values are stored with high enough precision.

In order to convert user units to viewport (physical) units and vice versa you only need the current transformation matrix, viewBox rect and viewport size. I have created a demo which shows how I can determine the line length in physical units: http://jsfiddle.net/9n5hf2jw/1/

The way how real world units are interpreted inside the SVG document is so messed up that even the SVG spec itself discourages their use:

Defining the size of a document in mm and then using mm units for shapes within it is going to give counterintuitive results, since they'll be converted to user units to resolve against the view box. (https://svgwg.org/svg2-draft/coords.html#Units)

jarek-foksa··on Inkscape 0.91 release
There is already an SVG editor written in Java called Kiyut Sketsa, it is unusable due to the poor performance of the Batik rendering engine (also written in Java).

It makes sense to use high level languages to manipulate the document model or to implement widgets, but when it comes to the renderer you want to be as close to the metal as possible.

jarek-foksa··on Inkscape 0.91 release
Implementation-wise, the only place where real world units such as "mm", "cm" or "px" make sense are the "width" and "height" properties of the outermost <svg> element.

This is because everything inside SVG document lives in an imaginary infinite world where dimensions and distances are expressed in abstract "user units".

You use "viewBox" attribute on the outermost <svg> element to specify a rectangular fragment of that world for the purpose of rendering. You use "width" and "height" properties to specify the real-world size of that fragment.

Authoring tools might show you dimensions of SVG objects such as rectangles or paths in real-world units computed from "viewBox", "width" and "height" of the outermost SVG element, but under the hood the size of those objects should be stored in user units.

jarek-foksa··on Inkscape 0.91 release
They didn't rewrite the whole software, that would take ages...

The migration from C to C++ was slowly progressing since Inkscape was forked from Sodipodi over 10 years ago, but there are still some C files remaining and SP* prefixes are used all over the place.

Besides, Sodipodi was already using simple GObject-based architecture.

jarek-foksa··on A Primer on Bézier Curves (2013)
Are there any creative tools that would make use of quadratic Bezier curves? While cubic Beziers are easier to tweak, it is much easier to draw smooth shapes with quadratic Beziers. They seem to be also easier to implement (only one control point), not sure why major vector and pixel graphics editors don't support them.

Ideally I would prefer to have an option to draw paths with either quadratic or cubic Bezier segments, but edit paths normalised to cubic Bezier segments.

jarek-foksa··on Why the West should be worried about Chinese Eugenics (2013)
Natural selection works fine, but relying exclusively on it might be dangerous for the human species in the longer run. Millions of species have died out because they were unable to adapt to the changing environment fast enough.

In the near future (in evolutionary timeline) in order to survive we might be forced to colonise other planets or cooperate with machines that are orders of magnitude more intelligent than we are today. We either learn how to adapt rapidly or we will be out of the evolutionary game.

jarek-foksa··on Why the West should be worried about Chinese Eugenics (2013)
Selective breeding is the primary reason why Canis lupus is one of the most diverse species now. Excessive interbreeding between races can impair diversity just like too little interbreeding.
jarek-foksa··on Why the West should be worried about Chinese Eugenics (2013)
If selective breeding based exclusively on IQ criteria would produce significant number of individuals with schizophrenia and other mental disorders then I would just update the breeding criteria to eliminate those unwanted traits from the gene pool as well. After all, evolution is all about trials and errors.
jarek-foksa··on The Final Countdown for NPAPI
Chrome team is planning to extend the touch events with stylus-specific functionality: https://docs.google.com/a/chromium.org/document/d/1x-yE4CmTZ...
jarek-foksa··on A Guide to SVG Animations (SMIL)
SVG 1.1 spec shares some definitions with SMIL spec, but if I recall correctly SVG working group is planning to get rid of any mention of SMIL in SVG 2 and instead rely on the terms and concepts outlined in the Web Animation spec [1] (the API will remain the same though).

I would change the title to "A Guide to Declarative Animation in SVG".

[1] http://w3c.github.io/web-animations/

jarek-foksa··on Angular 2 Core
I wouldn't call TypeScript an "ECMAScript 6 with types". It feels more like a superset of ECMAScript 5 as it introduces non-standard features such as static class properties and public/private scoping while major ES6 features such as proxies, symbols, generators, modules or block scoping are not supported.
jarek-foksa··on Become Estonia’s e-resident
I'm not sure if this applies to Holland, but generally countries with high taxes implement Controlled Foreign Corporation (CFC) laws which force you to pay local taxes even if company is registered offshore.

Whether a company is considered to be CFC depends on many factors such as double taxation treaties between the two countries, the amount of shares you own and the level of taxation in the offshore country.

jarek-foksa··on Gravit – Open-source design tool
It's worth noting that Gravit.io is a JavaScript rewrite of Stagestack project [1] which was an attempt to create commercial clone of Macromedia FreeHand from scratch [2]. Stagestack project failed due to lack of funding from FreeHand community.

[1] http://www.stagestack.com/

[2] http://www.freehandforum.org/news.html

jarek-foksa··on Paletton – Color Scheme Designer
What color space would be better than HSV? HSV- and HSL-based color pickers are intuitive, predictable and used by the majority of the designer-oriented apps: https://community.kde.org/Krita/Community_Mockups_and_Wishli...
jarek-foksa··on Videos about JavaScript
Thanks for response! You are right, I have just done some tests with a time-expensive "for" loop placed right before the addEventListener() call and the callback appears to be fired after the stack is cleared / the main function returns.
jarek-foksa··on Videos about JavaScript
I have a question about the talk by Philip Roberts ("Help, I'm stuck in an event-loop").

In the following code, assuming that there are no read errors, is the load callback guaranteed to be always executed? I.e. are DOM events dispatched only after the call stack is cleared?

  let main = () => {
    let reader = new FileReader();
    reader.readAsText(file);
    reader.addEventListener("load", callback = (event) => console.log(event.target.result));
  };
jarek-foksa··on Hybrid apps: Do not copy. Do get inspired. Avoid reimplementing native UI
WKWebView in iOS 8 and OS X 10.10 [1] and Chromium-based WebView in Android 4.4 [2] don't have the performance issues that the old WebView APIs used to have.

[1] http://www.youtube.com/watch?v=ZC_rNie61IQ

[2] https://developer.android.com/guide/webapps/migrating.html

← PreviousPage 5 of 11Next →