Profile cover photo
Profile photo
Nexii Malthus

How many people use Google Chrome DevTools as their primary editor?

It seems there should be a community formed around it, like some go-to place to talk about DevTools, a forum specifically. Especially better if it is frequented by the chrome developers working on it.

I'm sure people would love to hear how you can extend devtools with plugins and themes and what is available out there.

+Paul Irish could you kick off something, please?
Add a comment...

Relevant to fellow Google Chrome extension devs

Did you know that Chrome has an internal API for favicons?

For example, getting a 2x DPI favicon at 16px from the ArsTechnica site:

The API is structured as follows:
'chrome://' + iconType + '/size/' + iconSize + '@'+ pixelRatio + 'x/' + url;
iconType is 'favicon' or 'touch-icon',
iconSize is the resolution in pixels,
pixelRatio is pretty much just window.devicePixelRatio,
url which site to grab the favicon from.

Contemplating an idea: The ability to choose your preferred opensource license for libraries and/or documentation. That would be pretty cool.

If someone wanted to fork a library as GPL, they would be able to, etc. Hmmmm...
Add a comment...

Post has attachment
Here's a #CSS style I use to match #superscript & #subscript tags with the #photoshop algorithm, so that designs are a bit closer to the expectations (for generic fonts, got another photoshop sup style for Myriad Pro if you want it)

Trying to match photoshop typography with the HTML/CSS world or vice versa is always a pain, but at least this makes superscript work the same.

Additionally the styled superscript/subscript won't affect the height of the whole line, but rather is positioned relatively from the rest of the text baseline as it ought to be.

EDIT: Added subscript as well and hashtags.

Your website may not look as dean and modem as you might think.

WebKit will round letter-spacing values to the nearest pixel, which means your design likely has keming issues and is one dick away from disaster.

Post has shared content
Really surprising so many huge entities engage in anti-branding by using door slammers.

Its not too far off from the familiar practice of media outlets asking for you to subscribe before you can read more articles.
Add a comment...

Hypothesis: The longer the user interacts and/or stares at an image, the more they would prefer a higher quality version.

So, the longer an image is visible in the viewport of a site (along with other factors such as cursor attention and other human factors) the more you should try to improve the quality of the image post initial load IMHO. I had been thinking about to achieve this, it should be possible using canvas and drawing decoded delta frame updates on top over time to keep sharpening and enhancing the quality.

I'm somewhat unsure exactly what would be the best algorithm suitable for this. You could initially load a very lower quality JPEG and then do extra AJAX requests for delta frame payloads.

The lowest quality image could be inlined into the first HTML request of a page (for the time-to-glass phase) and then keep downloading further updates based on factors (device capabilities, network, etc) and user interaction (or non-interaction even if they are looking at the same location for a while).

Additionally this would be pretty awesome with responsive design.
Add a comment...

Post has shared content
On a side note, I am actually really amazed at the picture in this post and what it means in the culture of today compared to just ten years ago. (The article itself sugar coating this fact even further)

Looks like the visual idea of a person sitting infront of a computer has almost fully removed itself from the old stereotype of a "loser with no life" and turned 180 degrees towards the famous "thinker pose" - a human who is fully using their brain thinking power.

Not to mention the children next to her showing that it is acceptable and even social.

Anyone else notice this?

The future is really a lot closer than we think it is.
'Why your 8-year-old should be coding'

Really nice piece by +Jolie O'Dell in +VentureBeat about the +Tynker launch. 

(Now that I've posted this, I'll try to shut up about it for awhile... : )
Add a comment...

It seems people are confusing ASM.js with assembly and what it is actually about.

ASM.js would be actually perfectly in alignment with what Google wants to optimise V8 for. I was actually quite shocked in fact to learn it was mozilla to make the first move here, that is the extraordinary part IMHO.

ASM.js is a subset of javascript, as in, a style and consistency of coding, much like the famous book JavaScript: The Good Parts teaches you a subset of JS. ASM.js teaches you an optimizable style, it encourages you to write JS in a way that makes it easy to force static-typing.

Lets have an example (one of the first in the ASM.js spec even), we have a function that takes in a number, adds 1 to it and returns it:

function addOne(x) { return x + 1; }

In this case, we want to have x be an integer. So we have to coerce it from a number into an int:
x = x|0;
If we wanted to make sure it is a double, we would use:
x = +x;

The return type should be an integer as well, so we apply the same coercion on the result.
return x|0;

Everything together, we have this function:

function addOne(x) { x = x|0; return (x + 1)|0; } 

I definitely think ASM.js is more than just for emscripten, it is also for manually optimising libraries that may need the performance boost, for example I have math libraries for computing collisions, physics, interpolation and artificial intelligence that could definitely get a kick out of this.

(This is my own interpretation, have followed ASM.js before the media knew about it and the mozilla thing)
Add a comment...

Peculiar, does V8 in chrome do code optimisations that involve multi-threading?

I may have stepped into a case after investigation an odd bug, which seems to have been due to what looks like a race condition.

(Which in my case was pretty bad - caused multiple setIntervals where it only expected one and didn't clear the extra! If this code were perfectly sequentially then there would only ever be one interval running at one time for each object instance, so this is only possible with multi-threading)

My code seems to have spawned two threads from analysis and started merging again after running .apply on a function -- there was originally a debug message which was visible twice and printed an increment which made it seem like it always skipped one increment, despite showing the message twice -- the first hint I had of multi-threading and weirdness going on.

Here is a snippet of the console log: (with comments about what seems to be going on)

increment.b queued to 1 utilities.js:88 (first thread, increment variable '*queued*' number to 1)
increment.a queued to 2 utilities.js:69 (second thread, increment '*queued*' number to 2)
[ThrottleQueue:1] Timer reset ~ lateFn +1 (2) utilities.js:73 (this would have been the second thread, queued is 2 (correct))
[ThrottleQueue:1] No timer ~ lateFn +1 (2) utilities.js:91 (this would have been the first thread, queued is 2 (!!))
increment.a queued to 3 utilities.js:69 (process repeats, first thread here, goes to 3)
increment.a queued to 4 utilities.js:69 (second thread, 4)
[ThrottleQueue:1] Timer reset ~ lateFn +1 (4) utilities.js:73 (queued is 4)
[ThrottleQueue:1] Timer reset ~ lateFn +1 (4) utilities.js:73 (again, 3 is skipped and shows 4 instead)
increment.a queued to 5 utilities.js:69
increment.a queued to 6 utilities.js:69
[ThrottleQueue:1] Timer reset ~ lateFn +1 (6) utilities.js:73
[ThrottleQueue:1] Timer reset ~ lateFn +1 (6) 


For reference, I am using Google Chrome 27.0.1438.7 dev (default chrome://flags, not using special switches, etc.)
The above console.log()'s are from the same anonymous function() returned from one object instance.

I took out the function code into a gist and modified the debug messages a bit to clarify it. (The multi interval bug is fixed, but mutli-threading is still exhibited)

My code creates the throttleQueue on an object with an opts argument that looks like: { fn: function() { ... }, lateFn: function() { ... }, delay: 250, batch: true, maximumCallStack: 20 });
The returned function is then called 18 times in a short amount of time (so that all 18 calls are queued)

Is it just me, did I do something dumb or can other people reproduce this?

(For some background on throttleQueue: It is an extension of the traditional throttle function design taken to the next level - I needed to delay rendering of DOM elements by javascript and threw in the ability to batch all those renders together, this was all inspired by the recent Google Chrome mobile for android upgrade which brought in the accelerated rendering for scrolling, so I made a hacky variant for vertical hardware-accelerated lists in a Sencha app I am working on)
Add a comment...
Wait while more posts are being loaded