124 JSJ The Origin of Javascript with Brendan Eich – Javascript Jabber – DevChat.tv

Source: 124 JSJ The Origin of Javascript with Brendan Eich – Javascript Jabber – DevChat.tv

Very interesting, funny and informative podcast with Brendan Eich. You can also read the transcript at the bottom of the page. I really like to read about the people behind a famous software. It shows how good is to be alive, to be a developer and to be a smart guy.

Install x265 codec on Ubuntu 14.04

x265 is here and we have to deal with its support.

So using these commands I was able to play a x265 encoded video in the latest Ubuntu:

sudo apt-add-repository ppa:strukturag/libde265
sudo apt-get update
sudo apt-get install gstreamer1.0-libde265

Source: Install x265 codec on Ubuntu 14.04

Ubuntu: Open windows in the center of the screen – Ask Ubuntu

As a heavy Windows user I am used to have all not maximized windows to open somewhere in the center or where I put them last time. So I’ve decided to look around the Interwebz if I can do the same with Linux knowing that such things should already be discussed for Ubuntu Linux.

I’ve found this and will use it now to see if it makes the window placement like I am used to:

Open windows in center of screen – Ask Ubuntu.

Some PHP developer interview algorithms you must now

FizzBuzz:

http://3v4l.org/mIBmo

<?php

for ($i = 0; $i <= 30; $i++) {
    if ($i % 3 == 0 && $i % 5 == 0) {
        echo "$i: FizzBuzz; ";
    } elseif ($i % 3 == 0) {
        echo "$i: Fizz; ";
    } elseif ($i % 5 == 0) {
        echo "$i: Buzz; ";
    }
}

Swap 2 vars values without using a third one:

Numbers and strings with XOR:

http://3v4l.org/dsBvh

<?php

$a = 3;
$b = 5;

$a = $a+$b;
$b = $a-$b;
$a = $a-$b;

echo "a = $a; b = $b";

and:

http://3v4l.org/aqWcl

<?php

for ($i = 0; $i <= 30; $i++) {
    if ($i % 3 == 0 && $i % 5 == 0) {
        echo "$i: FizzBuzz; ";
    } elseif ($i % 3 == 0) {
        echo "$i: Fizz; ";
    } elseif ($i % 5 == 0) {
        echo "$i: Buzz; ";
    }
}

Swap 2 strings without using XOR:

http://3v4l.org/FDFDF

<?php
$a = 'texta';
$b = 'textb';
$a = $a . $b; //textatextb
$b = substr($a, 0, strlen($a) - strlen($b)); //texta
$a = substr($a, strlen($b)); //textb
echo "a = $a; b = $b";