Work Notes : Chrome Dev Tools

In progress …

array = $x('//p[text()="Changeset "]/a/text()')

for(a in array)console.log(array[a])

Netezza Emulator: In-Memory Run

I want two share some experience that I’ve got some time ago on the Netezza related testing.
This article is not just around Netezza emulator, but the approach described below allowed me to save a lot of time on testing within I/O-greedy configurations (the laptop was just equipped by slow IDE HDD but with 16 GB of RAM).

The problem I’ve faced was very slow performance of test SQL statements execution and I assumed that using of RAM Disk approach hypothetically could help me.

Starting from that point I planned to accomplish the following steps:

  • Find and Setup the RAM Disk for Windows software (I’m sure there are kind of alternatives are available for other platforms)
  • Setup it
  • Place the Netezza VM into the virtual disk and spin it in RAM
  • Get the performance profit :)

The progress and the pitfalls:

  • I’ve chosen the SoftPerfect RAMDisk as a software and it was really perfect. It’s useful and intuitive from installation and using perspectives.

SoftPerfect RAMDisk UI

  • I’ve placed the VM image into the newly created RAM folder (8GB). !Pitfall is there! When I didn't get expected performance boost, I've just installed the VMPlayer into the RAM folder as well as the VM image I've copied into it.
  • Started VMPlayer newly installed into RAMDisk
  • Started Netezza VM…

Viola! My Netezza VM start working 10 times faster

(on my own hardware of course :)

Embedding HTML5 Video in Reveal.JS Presentation

Some time ago I was talking to my friend Mairbek (@mairbek) about possible ways to make good and creative presentations. He advise me with the following solution that have been already tried out as a simple and lightweight HTML-framework with simple configuration, PDF-export, rich CSS and JS transformations etc. developed by one talented person @hakimel - (https://github.com/hakimel/reveal.js)

So, the decision was to use this framework for my presentation and I was really happy till I’ve faced a little problem that confused me in scope of my task “to make the presentation more creative” :). In fact I didn’t find an ability to insert and operate with video and spending some time on research I found a little workaround to make it possible for me without spending of extra-time to dive into the framework logic. I’ve just added dependency to JQuery and add two auxiliary functions into my presentation body to have make some magic to control my HTML5 video inside.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
...
<head>
...
    <script src="http://code.jquery.com/jquery-1.4.2.min.js"></script>
    <script>

    // This function start playing the video with id from current slide,
    // toggles it to the FullScreen mode and fires the CancelFullScreen()
    // at the end of the video.
    function toggleFullScreen(id) {
        var videoElement = document.getElementById(id);
        $("#"+id).bind('ended', function(){ document.webkitCancelFullScreen(); });
        videoElement.play();
        videoElement.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT);
    }

    // This part is to add a listener for <Enter> key and to call toggleFullScreen()
    // function with the video ID that is dynamically obtained from the CURRENTLY displayed slide.
    document.addEventListener("keydown", function(e) {
        if (e.keyCode == 13) {
            toggleFullScreen($('.present').find('video').attr('id'));
        }
    }, false);

        </script>
...

Including the HTML5 video into Reveal.js

So, at this point I was able to include something like that and control the video start by hitting the key.

1
2
3
4
5
6
7
...
<div class="reveal">
  <div class="slides">
    <section>
    <video id="myvideo" src="video/test.ogv" type="video/ogg" style="heigth: 50%; width: 50%;" />
    </section>
...

You can download the demo zip-file here and open the ‘index.html’ after unpacking.
(12Mb with sample video)

Or you can just click here to see a little GIF-demo.