Thursday, October 31, 2013

Lightbeam for Firefox (mozilla.org)

Shine a light on who’s watching you. Lightbeam is a Firefox add-on that uses interactive visualizations to show you the first and third party sites you interact with on the Web. As you browse, Lightbeam reveals the full depth of the Web today, including parts that are not transparent to the average user. Read more...

Wednesday, October 30, 2013

Lisp for C++ programmers (prog-elisp.blogspot.ru)

One old good friend of mine, whom I respect a lot and who is a very good C++ programmer, recently asked me to give him an example of how it's possible make new language features in Lisp. He's aware of Lisp's ability to invent new syntax, and he's also excited about C++11. So he wonders how is that possible to introduce new syntax into your language all by yourself, without having to wait for the committee to adopt the new feature. Read more...

Monday, October 28, 2013

MongoDB is to NoSQL like MySQL to SQL — in the most harmful way (use-the-index-luke.com)

Yesterday evening I tweeted: “MongoDB seems to be as bad for NoSQL as MySQL is for SQL.” Unfortunately, I tweeted without context. But I guess I couldn’t have given all the required context in a single tweet anyway, so I’m dedicating this post to it. I hope this answers some of the questions I’ve got in response to the tweet. Read more...

Call me maybe: Cassandra (aphyr.com)

Cassandra is a Dynamo system; like Riak, it divides a hash ring into a several chunks, and keeps N replicas of each chunk on different nodes. It uses tunable quorums, hinted handoff, and active anti-entropy to keep replicas up to date. Unlike the Dynamo paper and some of its peers, Cassandra eschews vector clocks in favor of a pure last-write-wins approach. If you read the Riak article, you might be freaking out at this point. In Riak, last-write-wins resulted in dropping 30-70% of writes, even with the strongest consistency settings (R=W=PR=PW=ALL), even with a perfect lock service ensuring writes did not occur simultaneously. To understand why, I’d like to briefly review the problem with last-write-wins in asynchronous networks. Read more...

Friday, October 25, 2013

Knockout v3.0.0 released (knockoutjs.com)

Knockout.js takes backward compatibility seriously. If you’re using a recent v2.x build, you will typically be able to drop in Knockout v3.0.0 without having to make any changes to your application code. Version 3.0.0 is intended to be fully backward-compatible except for a few carefully chosen design changes that enable major new features or fix longstanding issues.

Here follows new features:

  • Computed properties now notify only when their value changes
  • Bindings are now refreshed independently
  • optionsCaption now HTML-encodes its output
Read more...

Thursday, October 24, 2013

TypeScript 0.9 & 0.9.1– What’s Improved (flippinawesome.org)

I’ve been noodling around with Typescript for a while and enjoying the various improvements over standard Javascript. Quite a bit of this comes from ES6 improvements which Typescript incorporates (and transforms to a sensible ES3 output) – for example real classes, and this-capturing lambda expressions that help avoid the number one kick-yourself error of Javascript stupidity.

Syntactic sugar aside, there are a few reasons I like Typescript. An improved IDE experience in VS (and VS2012 is already quite good with intellisense via jsdoc comments and JS execution). Static typing improves the self-documenting nature of code, helps enforce a cleaner design, and ensures program correctness. Type definition files are available (for example, the DefinitelyTyped project maintains a good selection) for popular JS libraries to allow their use with full type information in a Typescript program, and this interoperability is huge.

In this post I’m going to discuss some of the important improvements in the recent TypeScript 0.9 and 0.9.1 releases. Read more...

Tuesday, October 15, 2013

For Best Results, Don't Initialize Variables (codinghorror.com)

I noticed on a few projects I'm currently working on that the developers are maniacal about initializing variables. That is, either they initialize them when they're declared or they initialize them in the constructor. Well, this all struck me as unnecessary work in the .NET world. Sure, maybe that's the convention in the wild and wooly world of buffer overruns C++, but this is managed code. Do we really want to play the I'm smarter than the runtime game again? Read more...

Friday, October 11, 2013

Why Registers Are Fast and RAM Is Slow (mikeash.com)

In the previous article on ARM64, I mentioned that one advantage of the new architecture is the fact that it has twice as many registers, allowing code load data from RAM less often, which is much slower. Reader Daniel Hooper asks the natural question: just why is RAM so much slower than registers? Read here...

Wednesday, October 9, 2013

Firefox Developer Tools and Firebug (hacks.mozilla.org)

If you haven’t tried the Firefox Developer Tools in the last 6 months, you owe it to yourself to take another look. Grab the latest Aurora browser, and start up the tools from the Web Developer menu (a submenu of Tools on some platforms).

The tools have improved a lot lately: black-boxing lets you treat sources as system libraries that won’t distract your debugging flow. Source maps let you debug source generated by transpilers or minimizers. The inspector has paint flashing, a new font panel, and a greatly improved style inspector with tab completion and pseudo-elements. The network monitor helps you debug your network activity. The list goes on, and you can read more about recent developments in our series of Aurora Posts. Read more...

Friday, October 4, 2013

DRM in HTML5 (bugzilla.mozilla.org)

The Director of the W3C, Tim Berners-Lee, has stated that playback of protected content (i.e. DRM) is in scope for HTML5. [1] This was further confirmed in the charter on 20th September. [2]

According to the Director,

"While the W3C Team do believe that use cases like premium content should be addressed in the Open Web Platform in order to bring it to its full potential, we're also looking forward for the HTML Working Group to address any technical concerns raised against the EME draft."
1. http://lists.w3.org/Archives/Public/public-html-admin/2013Feb/0122
2. http://lists.w3.org/Archives/Public/public-html-admin/2013Sep/0129.html

Read more

Using Katas To Improve (blog.8thlight.com)

When I joined 8th Light, I came across katas. The idea of a kata is to practice coding by doing it repetitively. You build muscle memory in the mechanics of coding -- setting up the editor, reacting to errors, letting your fingers get used to the controls. Initially I thought it was an amusing little activity. Then I started to wonder if I can do a kata on something more than coin-changer or roman numerals, something with a little more substance. I thought it could be possible to write tic-tac-toe as a kata. My main goal is to develop a workflow so I can write it under an hour. I also wanted to record myself and bought Screenflow. After all, the kata is meant to be a performance. Read more...

new UNIX implementation (groups.google.com)

Starting this Thanksgiving I am going to write a complete Unix-compatible software system called GNU (for Gnu's Not Unix), and give it away free to everyone who can use it. Contributions of time, money, programs and equipment are greatly needed.

To begin with, GNU will be a kernel plus all the utilities needed to write and run C programs: editor, shell, C compiler, linker, assembler, and a few other things. After this we will add a text formatter, a YACC, an Empire game, a spreadsheet, and hundreds of other things. We hope to supply, eventually, everything useful that normally comes with a Unix system, and anything else useful, including on-line and hardcopy documentation. Read more...

Wednesday, October 2, 2013

Firefox: MemShrink progress, week 117–120, fix saves gigabytes of memory on image-heavy pages (blog.mozilla.org)

Lots of important MemShrink stuff has happened in the last 27 days: 22 bugs were fixed, and some of them were very important indeed. Read more.

Dynamic Google Maps loading

Usually if you include script tag in head of HTML document JavaScript library is loaded at the time of page load. If you want to reduce page download time you can defer loading JavaScript library until it is required. This JavaScript technique sometimes is called “Asynchronous“ or „On demand” JavaScript loading. Here I will show you how you could defer loading of Google Maps library. In first example I will use JQuery library and plain JavaScript in second. Pay attentional to the callback parameter in the query string we use to request Google Maps service. This parameter tells library which your function it should call then library is loaded.

Here follows simple html we use in our example:

<html>
    <head>
        <meta charset="utf-8" />
    </head>
    <body>
 <p>See the Maps API used to embed a map into an HTML page without JS errors:</p>
 <div id="google-map" style="width: 400px; height: 400px;"></div>

 <script type="text/javascript">
<!-- One of the following script variants gose here -->
 </script>
    </body>
</html>

Defer loading of Google Maps library by using JQuery:

$.getScript("http://maps.google.com/maps/api/js?sensor=false&async=2&callback=gMapsCallback");

function gMapsCallback() {
    var location = new google.maps.LatLng(41.890522, -87.668753);
    var options = {
        center: new google.maps.LatLng(41.890540, -87.668753),
        zoom: 14,
        mapTypeId: google.maps.MapTypeId.ROADMAP
    };
    var map = new google.maps.Map($('#google-map')[0], options);
    var content = '<div style="width: 200px;">Hello!!!</div>';
    var marker = new google.maps.Marker({
        position: location,
        map: map,
        title: 'DevBridge Group'
    });
    var infowindow = new google.maps.InfoWindow();
    infowindow.open(map, marker);
    infowindow.setContent(content);
}

Defer loading of Google Maps library by using plain JavaScript:

    var element = document.getElementById('google-map');
    var script = document.createElement('script');
    script.type = 'text/javascript';
    script.src = 'http://maps.google.com/maps/api/js?sensor=false&async=2&callback=gMapsCallback';
    element.parentNode.insertBefore(script, element.nextSibling);
  
    function gMapsCallback() {
        var location = new google.maps.LatLng(41.890522, -87.668753);
        var options = {
            center: new google.maps.LatLng(41.890540, -87.668753),
            zoom: 14,
            mapTypeId: google.maps.MapTypeId.ROADMAP
        };
   
        var mapElement = document.getElementById('google-map');
        var map = new google.maps.Map(mapElement, options);
        var content = '<div style="width: 200px;">Hello!!!</div>';
   
        var marker = new google.maps.Marker({
            position: location,
            map: map,
            title: 'DevBridge Group'
        });
   
        var infowindow = new google.maps.InfoWindow();
        infowindow.open(map, marker);
        infowindow.setContent(content);
    }

That is all to it.

Tuesday, October 1, 2013

RyuJIT: The next-generation JIT compiler for .Net (blogs.msdn.com)

The world is moving to 64-bit computing even though it isn’t always faster or more efficient than 32-bit. A lot of programs run faster on 32-bit than on 64-bit, for a variety of reasons. One example of this is the 64-bit JIT compiler in .NET. It does a great job of making your program run fast, but it’s not a fast program itself. All that’s about to change: a new, next-generation x64 JIT compiler that compiles code twice as fast is ready to change your impressions of 64-bit .NET code. Read more....