Lazy Loading in php with spl_autload

Posted on Tue 04 April 2017 in blog

Today, a very short post about the lazy loading in PHP: spl_autoload. I'll not expose everything about it here, cause it's already done here: http://php.net/autoload.

Basically, a Lazy Loading allow you to predifine some paths where PHP should seek for classes to include, this allow you to …


Continue reading

nfsmount: rpc failed: 2

Posted on Tue 04 April 2017 in blog

For those, here on the internet, asking themselves what is this fscking rpc failed: 2 while mounting an NFS, it's possible that the response is here: Your NFS client trying to mount the NFS share will use RPC to communicate with the serveur, il will go like:

> PORTMAP GETPORT(Program …

Continue reading

Numeric arguments in emacs

Posted on Tue 04 April 2017 in blog

I'm starting an 'emacs trick of the day' sequence with:

  • Function name: universal-argument
  • Typical Key binding: C-u
  • How to get help: C-h f universal-argument
  • Usage: C-u

Receive a numeric argument that is given to the next called function, when no numeric argument is typed, the value defaults to 4. So …


Continue reading

Pipe: Infix syntax for Python

Posted on Tue 04 April 2017 in blog

Pipe is a Python module enabling infix syntax in Python. For those asking "Why ?" let's take an example: Compare the readability of the classical prefix syntax:

sum(select(where(take_while(fib(), lambda x: x < 1000000) lambda x: x % 2), lambda x: x * x))

And the infix syntax:

fib() | take_while(lambda …

Continue reading

Post data lost on 301 Moved Permanently

Posted on Tue 04 April 2017 in blog

What the hell with 301 Moved Permanently HTTP header!? I'll take an exemple to explain my ugly problem, take, a (very ugly cause it's PHP) index.php, it could be retrieved by using:

  • http://example.com/directory/index.php Got the page, 200 OK or
  • http://example.com/directory/ Got …

Continue reading

Python: Consulting PEPs from command line, while being offline

Posted on Tue 04 April 2017 in blog

One day I wished I could read PEPs in the tube on my laptop... so I searched for a convenient way to do so, and I didn't found ... So I wrote a very simple shell script you can found here : https://github.com/julienpalard/pep I'm currently packaging it for …


Continue reading

Python coroutines with async and await

Posted on Tue 04 April 2017 in blog

This is a short introduction of the basic vocabulary and knowledge needed to start with async and await, we'll go from "scratch", but not from the whole "let's use generators" era, when everything started, but from a contemporary (Python 3.5) point of view with natives coroutines, async, await.

Coroutine …


Continue reading

Python: Introducing ppipe : Parallel Pipe

Posted on Tue 04 April 2017 in blog

/!\ this was highly experimental code written in 2011. Today you should NOT use it, just look at it if the subject amuses you. Better take a look at asyncio if you want this kind of tools.

I'll speak about my pipe python module so if you didn't know it, you …


Continue reading

Searching and replacing in emacs

Posted on Tue 04 April 2017 in blog

Day two of my serie about emacs, about searching and replacing.

  • Function name: isearch-forward
  • Typical Key binding: C-s
  • How to get help: C-h f isearch-forward

isearch-forward let you type a string to be searched incrementally in the current buffer, successive following C-s will jump to the next match.

  • Function name …

Continue reading

squid: (101) Network is unreachable when DNS returns IPv6

Posted on Tue 04 April 2017 in blog

If you have a Squid proxy configured on a machine that have no IPv6 connectivity, and try to reach an IPv6 compatible site, you squid will try to reach the site using IPv6 (I use squid 3.1.6 from Debian Squeeze) and will fail without even trying IPv4, displaying …


Continue reading