Tail Call Optimization implementation in Javascript Engines [duplicate]

TCO, or rather, Tail Call Elimination in JavaScript — also often referred to as Proper Tail Calls (PTC) in discussions — is a long and sad story. Around 2011, TC39 (the JavaScript standards committee) decided to adopt mandatory TCE for the forthcoming ES6 standard, with consensus from all major browser vendors. In 2015, the new … Read more

Firefox does not seem to be faster using the asm.js profile, yet Chrome is

When you run code in Firefox, you can often see huge drop in speed for asm.js calls, which is most probably caused either by repeated compilation (which is visible in console) or by cost of js-to-asm calls. This hypothesis is further strenghtened by Luke Wagner, implementor of asm.js: one performance fault that we already know … Read more

Way to debug CORS errors

Which version of Chrome are you using? The latest versions have become much better at reporting CORS issues. For example, I am using Chrome version “32.0.1700.14 beta”, and when I visit this page, I get the following error in my console: Request header field X-Foo is not allowed by Access-Control-Allow-Headers. This information is only available … Read more

Firefox refresh current tab from command-line

You can use xdotool for automation. Install on Ubuntu with sudo aptitude install xdotool Then you can search for windows and send keys or mouse events, see man xdotool for the full documentation. I use following script on Ubuntu 16.04 LTS during development: WID=`xdotool search –name “Mozilla Firefox” | head -1` xdotool windowactivate $WID xdotool … Read more

How to check if an element exists?

You can check if an element exits or not by using bool isElementDisplayed = driver.findElement(By.xpath(“element”)).isDisplayed() Remember, findElement throws an exception if it doesn’t find an element, so you need to properly handle it. In one of my applications, I handled an exception by checking the element in a separate function: private bool IsElementPresent(By by) { … Read more

CSS: Flex Box not printing all pages on Firefox

Having looked into this for a bit now, I’m still not sure what about Firefox causes printing flex containers to be cut off. I found some extremely old bug reports on Bugzilla (eg. https://bugzilla.mozilla.org/show_bug.cgi?id=258397), but they had something to do with overflow properties on the body tag. Unfortunately, trying to adjust the overflow of body … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)