1. Pipe: Infix syntax for Python

    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 …
    read more
  2. YAUIB : Yet another useless IRC Bot !

    After 2 years of... non blogging... I'm back! This time I stopped C# (Oh yeah !) and I'm writing a lot of Python! (Oh YEAH !) So to say HELLO I'll present something useless: My Python IRC Bot. But this article should be usefull, so I'll speak about the Unix Philosophy: As …

    read more
  3. Post data lost on 301 Moved Permanently

    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 …
    read more
  4. C# Using alias directives

    Just found in section 9.4.1 of the C# language specification: The using keyword can be used to alias a namespace or a type name:

    using-alias-directive: using identifier = namespace-or-type-name ;

    You can read more about that here : csharp language specification.doc, Or just try to use it:

    // As the specification …
    read more
  5. Covariance and Contravariance in C#3

    A short introduction to Covariance and Contravariance in C# 3 preparing you to an article about that in C# 4. So what is covariance? Covariance is basically using a method which returns something derived from the expected type. An exemple? It's safe to have a method returning a cat when …

    read more
  6. Combinatory logic from scratch

    Cause it's sooooo sexy, let's speak about Combinatory Logic!

    • Rule 1: You don't talk about Combinatory Logic
    • Rule 2: You don't talk about Combinatory Logic
    • Rule 3: Combinatory Logic is based on Lambda Calculus (see Wikipedia for both)
    • Rule 4: A combinator is a Lambda expression taking One and only …
    read more
  7. The ?? operator aka the Null Coalescing Operator

    If are familiar to the use of ternary operators, you must have encountered several situations like this one :

    :::csharp string pageTitle = getTitle() ? getTitle() : "Default Title";

    You would want to call getTitle() only once, but then you wouldn't have a simple one-lined initialization of you variable. Actually there is a simple …

    read more
  8. Lazy Loading in php with spl_autload

    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 …

    read more
  9. Exclude directories from recursive grep

    How often are you using grep in subversionned folders like that:

    grep -rni foobar . | grep -v .svn
    

    Upgrade to grep 2.5.3 and use (alias it ?)

    grep -rni --exclude-dir .svn foobar .
    

    (or ... stop using SVN !!!)

    read more

« Page 3 / 4 »