JavaScript, Date and ISO 8601 part2

I had a JavaScript date issue some time ago. Today I looked at the sources of ChakraCore and dug to the point of interest. // Compute the time value timeValue = TvFromDate(year, month, day, timePortionMilliseconds - utcOffsetMilliseconds); if (isLocalTime) { // Compatibility note: // In ES5, it was unspecified how to handle date strings without the trailing time zone offset "Z|(+|-)HH:mm". // In ES5.1, an absent time zone offset defaulted to "Z", which contradicted ISO8601:2004(E). // This was corrected in an ES5.1 errata note. Moreover, the ES6 draft now follows ISO8601. timeValue = GetTvUtc(timeValue, scriptContext); } DateImplementation.cpp line 990   Let's have a look at the ISO8601:2004. B.1.3 Date and time of dayCombinations of calendar date and local time Basic format Extended format Explanation 19850412T101530 1985-04-12T10:15:30 Complete Let's have a look at the EcmaScript 2015 spec at Date Time String Format ( If the time zone offset is absent, the date-time is interpreted as a local time. So as long as I'm running ES5.X Internet Explorer and Edge are wrong according to the EcmaScript spec. Which can be considered wrong according to the ISO spec and is corrected for ES6. <sarcasm>What a wonderful place the web is</sarcasm> I can understand somehow that Microsoft is not fixing this as it is for the old spec. So the next task is to see how the other browsers behave when forced to run ES6

Allow your account to sudo

I have the installed the bash of the Linux sub system on my windows 10 now for quite some time. Today the prompt informed me about available updates for packages. I tried to sudo to run the apt command but failed.lennybacon is not in the sudoers file. This incident will be reported. So I had a look at the /etc/sudoers file:... # Members of the admin group may gain root privileges %admin ALL=(ALL) ALL ... So I decided to not modify the file and add my account to the admin group:usermod -aG admin lennybacon Now I can sudo! HTH, Daniel

If time is an issue, the lack of reading might be the root cause

Look at the following code:var x = new Date('2016-01-29T14:00:00'); console.log(x.getTime()); Running it in different browsers is surprising1454076000000 // Chrome | FF | Opera 1454072400000 // IE | Edge MDN says: The getTime() method returns the numeric value corresponding to the time for the specified date according to universal time. I repeat according to universal time! ECMA Script Spec says: Time is measured in ECMAScript in milliseconds since 01 January, 1970 UTC Pretty accurate. Let's change the code slightly by appending a Z at the end of the string being parsed as date: var x = new Date('2016-01-29T14:00:00Z'); console.log(x.getTime()); Here are the results:1454076000000 // Chrome | FF | Opera 1454076000000 // IE | Edge So it's definitely NOT the getTime() part that lacks. ECMA Script Spec says: The String may be interpreted as a local time, a UTC time, or a time in some other time zone, depending on the contents of the String. The function first attempts to parse the format of the String according to the rules called out in Date Time String Format ( If the String does not conform to that format the function may fall back to any implementation-specific heuristics or implementation-specific date formats. Where the Date Time String Format ( says The value of an absent time zone offset is “Z”. I repeat Z, which is universal time! If only the IE/Edge team was able to read and understand the specs... HTH, Daniel

Why Microsoft's Browser Developer Tools suck

Ok, this is kind of a rant post. I acknowledge that Microsoft is really really doing a good job at certain (developer) spots (ASP.NET, Visual Studio, IIS, SQL Server, …). But NOT at the browser developer tools – I’m listing my issues here, hoping the IE-Team will listen and make the world better for everybody. Dev Tools Pinning Location Why can’t I pin the developer toolbar on the right side as in every other browser. Screens with 4:3 have gone. Widescreen is the standard. Pinning at the bottom makes no sense to me (in most cases). Edge IE11 Firefox Chrome Opera Open Developer Tools At Start Tab In Edge the ability to open developer tools is disabled … for whatever reason:   In internet explorer with about:blank this was possible… Q: So how can i network trace an initial request? A: Go somewhere else, Hit F12, then do what you originally wanted to do #this-is-not-intuitive Opera, Chrome, Firefox Explicit enablement of network trace (<Win10) Thank you for fixing that on Windows 10 – in IE11 on Win 8.1 it’s still disabled by default. Please offer an update for IE/<Win10. Initiator of network request (<Win10) Thank you for fixing that on Windows 10 – in IE11 on Win 8.1 it’s still shows <script> and not the specific script with line and char. Please offer an update for IE/<Win10. IE11.0.9600.18161/Win8.1 IE11.63.10586.0/Win10 Dockability of Tools Window Thank you for fixing that on Edge – In IE 11 the tools window cannot be docked with [Win] + [left|right]. Dark Theme FF developer edition does it. Chrome can do it. IE and Edge lack a dark theme, seriously. Call to action So c’mon Edge Devs. Make the web developers life easier. surprise us. you can do better!

Maven Archetypes in IntelliJ

IntelliJ has the ability to use Maven as build and project system. The concept of an archetype is a predefined project or project template.When “File | New project” is used to create a new project and “Maven” is selected the following dialog is displayed:IntelliJ comes with a few archetypes but of course custom ones can be added. On the MVN Repository for example several archetypes for Wildfly are available: XML snipped can be used as copy-paste-source for IntelliJ’s “Add archetype dialog”:After clicking the “OK” button the newly added archetypes are available as a source for the project creation. The custom archetypes are stored in the file “C:\{username}\Daniel\.IntelliJIdea{version}\system\Maven\Indices\UserArchetypes.xml” on Windows and “~/.IntelliJIdea{version}/system/Maven/Indices/UserArchetypes.xml” on Linux. Next define group and artifact identifier as well as version for the new project:Select the Maven version:And the project location:The result is a runnable quick start for working with the Wildfly application server.

Code Snippets in IntelliJ

Code snippets can be helpful. Otherwise the can lead to code duplicates – so use them with wisely.In JetBrains IntelliJ the code snipptes are called Live Templates. They are stored in files saved in C:\Users\{UserName}\.IntelliJIdea{Version}\config\templates on Windows and ~/.IntelliJIdea{Version}/config/templates on Linux. To create a live template open IntelliJ and open the Settings from the File menu:In the Settings dialog you can use the search text box to quickly access the Live Templates section:Now just select the Language and use the green plus button on the upper right to add a new one (like the iife that I just added here).There is a special placeholders that can be used aside from variables:$SELECTION$The Edit variables button switches to enabled state as soon as you user a variable name in the code.

Disabling Registry-System-Redirection on 64bit

x64 view from x86: using Microsoft.Win32; using(var registryKey = RegistryKey.OpenBaseKey( RegistryHive.LocalMachine, RegistryView.Registry64 ).OpenSubKey(@"Software\Microsoft\InetStp\Components")) { var value = registryKey.GetValue(@"WMICompatibility"); } x86 view from x64: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft

Disabling File-System-Redirection on 64bit

The following call disables File-System-Redirection on 64bit Windows in WOW mode (e.g. Accessing Program Files and ending up in Program Files (x86)): // Minimum client Windows XP Professional x64 Edition or higher // Minimum server Windows Server 2003 with SP1 or higher NativeMethods.Kernel32.Wow64DisableWow64FsRedirection(pt1);