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 Creating SVG vector graphics for maximum browser compatibility
There is a lot of wrong data in the "Browser compatibility" table at the end of the article:

- gradient meshes were never defined in SVG spec and none of the browsers supports them. This feature should be introduced in SVG 2

- WebKit-based browsers do support inner and outer glow effect (via combination of feGausianBlur, feFlood and feComposite filters)

- WebKit-based browsers do support drop-shadow effect (via feGausianBlur, feOffset and feMerge filters)

- WebKit-based browsers do support custom fonts (e.g. WOFF via @font-face, SVG fonts are dead)

- WebKit-based browsers do support linked and embedded images (using data:uri with base64 encoding)

- envelope distortion is not supported by any browser, SVG spec defines only affine transformations via transform attribute

jarek-foksa··on Hacking Mountain Lion: Bringing the old Web Inspector back
It's developement version, but I wouldn't call it super-buggy. WebKit project has strict development process, each commit is rigourously reviewed and tested before merging.

You will likely run into problems if you enable experimental flags though.

jarek-foksa··on Hacking Mountain Lion: Bringing the old Web Inspector back
Replacing WebKit, WebCore and JavaScriptCore frameworks is a bit risky because many system components depend on them. I would replace only inspector files (mostly JavaScript) instead as described in https://gist.github.com/3898054
jarek-foksa··on A whole SVG Tiger
I have seen this tiger used as example in several places. Does vector graphics has more such semi-standard test images? (in a simillar fasion to http://en.wikipedia.org/wiki/List_of_common_3D_test_models)
jarek-foksa··on Adobe's Source Code Pro Font
On most distros third-party fonts can be installed locally in ~/.fonts/
jarek-foksa··on Things I learned at JavaOne 2012
WebView-based apps might look a bit crappy compared to fully native apps, but the ultimate goal is to make as many consumers as possible buy your product. Depending on JRE is defenitely not going to help you reach that goal.
jarek-foksa··on Things I learned at JavaOne 2012
You won't be able to submit such app to Windows 8 Store, Chrome Web Store, iOS App Store, Android Market and you will very likely run into problems when submitting it to Mac App Store because of process sandboxing and restrictions on private APIs.

Users will be pissed off because your app starts slowly, does not integrate well with system services and takes a lot of disk space.

I would just use native code for implementation of platform-specific features (e.g. filesystem access, window management, dock icon, settings manager), everything else could be done inside WebView. This way you can cover all possible platforms including regular web browsers.

jarek-foksa··on Things I learned at JavaOne 2012
> JavaFX is now a very serious option for client development

I wouldn't be surprised if Oracle killed JavaFX next year. I can't think of any serious project that would rely on it. Requiring users to download whole Java JRE is not a viable option any more.

jarek-foksa··on The Code Side Of Color
Web browsers also seem to be using RGB for storing colors internally. You can specify colors in HSL, but retrieved values are only in RGB. E.g. if you write "hsl(100,0%,0%)" in your CSS file then the color will be represented as #000000 in DOM/CSSOM. This is especially annoying when you are trying to implement color picker because information about hue is lost if saturation or lightness are low.
jarek-foksa··on Understanding Javascript OOP
From my read of the proposal ES6 classes feel more like syntactic sugar for the flawed concept of new/constructor/obj.prototype, you still have to mess with obj.prototype to achieve some tasks (e.g. define non-enumerable property). I would stay away from it and just use plain objects with Object.create().
jarek-foksa··on CSS Flexbox Please
"Partial" implementations don't implement the current spec at all, check the footnote. New flexbox uses completely different syntax than the old one and it's impossible to polyfill it on IE8 and IE9 without excessive use of JavaScript.
jarek-foksa··on Dropbox dives into CoffeeScript
I always felt that function hoisting is harming code readability. I prefer reading the code from top to bottom, I don't want to stuble upon functions that were not declared before.

If I recall correctly the main reason why this feature is not supported by CoffeeScript is because of some awkward IE bug though.

jarek-foksa··on Javascript the right way
For explanation of JS inheritance I would recommend reading http://killdream.github.com/blog/2011/10/understanding-javas..., it's actually superior to what you will find in Crocoford's book.
jarek-foksa··on Javascript the right way
http://i.imgur.com/Ml2Jb.jpg

Sorry, I couldn't resist...

jarek-foksa··on Javascript the right way
Here is what I prefer to call a singleton in JS, I don't think it could be any simpler than that:

  mySingleton = {
    initialized: false,

    init: function() {
      if (this.initialized == false) {
        this.initialized = true;
        // Initialize the singleton here
      }
      return this
    },
  }

  singleton1 = mySingleton.init()
  singleton2 = mySingleton.init()
Both underscore notation and returning "public" methods feel awkward in JavaScript, though the second appraoch introduces major trade-offs which I belive are not worth it. E.g. how do you create inheritance chains when using this pattern? Are you just copying public methods returned from one object into another? Or how do you inspect private properties in Dev Tools? Are you setting breakpoints for that purpose?
jarek-foksa··on Javascript the right way
There are no modules in JavaScript as well. At least not in ES5.
jarek-foksa··on Javascript the right way
The way how Addy Osmani implements singleton pattern is rather disputable. I would implement singleton as a regular object that returns itself immediately if initialized for the second time.

His prototype pattern also doesn't look like the right way of doing things. Is there actually anyone that uses plain object descriptors? I would just create helper method that wraps Object.create() and takes prototype object as first argument and instance object as second argument. There is no need to use constructors in this pattern (either directly or inside helpers) unless you are targetting legacy browsers.

I also dislike the fact that public/local scope is emulated by misusing the return statement - this is ugly, confusing and it doesn't play nicely with other patterns such as prototype. If you need some notion of public/private scope then just use underscore notation.

jarek-foksa··on Secret Origin of SVG
Amaya does not render correctly the most basic SVG files. Even IE6 would make a better reference implementation of web standards.

Batik seems to be the most well-tested and conformant implementation of SVG at the moment: http://xmlgraphics.apache.org/batik/status.html, though I would use WebKit as reference because of it's market share and potential of Google and Apple to change the SVG spec.

jarek-foksa··on Secret Origin of SVG
May I know which applications/start-ups do you mean? I'm working on a web-based SVG editor myself because I was unable to find such tool on the market. I can only think of SVG Edit which is unlikely to be ever usable considering how messy its code is.
jarek-foksa··on CoffeeScript source maps
Is CoffeeScriptRedux actually ready for production use? From my read of https://github.com/michaelficarra/CoffeeScriptRedux/wiki/Pro... there are many features missing.
jarek-foksa··on Realtime Three.js Coding
Commercial version of Harmony that can be integrated with third-party apps would be great. I guess you could use simillar licensing model to Potrace: http://potrace.sourceforge.net/#dual
jarek-foksa··on Realtime Three.js Coding
Are you still planning to release commercial version of Harmony? I remember that you were mentioning it few months ago on Github.
jarek-foksa··on 3.7X speedup from removing a call to sleep
The patch was committed on 2012-05-17, so it should be already present in Safari for OSX 10.8.
jarek-foksa··on Backbone has made me a better programmer

  matcher: function (item) {
    return ~item.toLowerCase().indexOf(this.query.toLowerCase())
  }
Why there is "~" bitwise operator used in this method?
jarek-foksa··on Backbone has made me a better programmer
What's the point of this excessive chaining? I use CoffeeScript a lot, but your code looks unreadable to me.
jarek-foksa··on PrismJS
But smaller does not always mean better. Benchmarks have shown that parsers based exclusively on regular expressions can be even several times slower than parsers that use scanner/tokenizer.

The bigger regExps you write, the slower and more bug-prone your code will be.

jarek-foksa··on Firefox OS doesn’t stand a chance
I would argue about frontend developers feeling anyhow inferior to Java/Android developers. It just doesn't make sense to learn entire new platform to ship some random app.

You can't be a good programmer if you are jumping from one technology to another too often. I would prefer to use an app written in HTML/CSS/JS by experienced frontend developer than an app written in Java by someone who just read "Teach Yourself Java in 24 Hours (Covering Java 7 and Android)".

jarek-foksa··on All of the available CSS color names
There are 147 color names, but the number of colors in CSS3 spec is a bit smaller because of duplicates (e.g. gray and grey are the same color).

I would rather prefer to comment my code than use some of the more convoluted names. In CSS3 we can also specify colors with HSL format which is more natural and universal than made-up names.

jarek-foksa··on How to work with Scalable Vector Graphics (SVG) in HTML 5
"SVG Primer for Today's Browsers" has more detailed introduction: http://www.w3.org/Graphics/SVG/IG/resources/svgprimer.html, you can skip SMIL section as it's probably going to be deprecated.
jarek-foksa··on Show HN: Collections, a fast multiple-account Google Docs client for Mac
This is the case at least with apps from Mac App Store. Safari uses WebKit2 which is a private framework. If you want to ship your app on Mac App Store you have to use WebKit1 which does not support split-process model. Flags that enable GPU accelerated compositing are also private on Lion.
← PreviousPage 8 of 11Next →