Thursday, November 25, 2010

Sorting

from wikipedia:

Name Best Average Worst
Memory Stable Method
Other notes
Insertion sort  \mathcal{}  n  \mathcal{}  n^2  \mathcal{}  n^2 \mathcal{} {1} Yes Insertion Average case is also \mathcal{O}\left( {n + d} \right), where d is the number of inversions
Binary tree sort \mathcal{} {n \log n} \mathcal{} {n \log n} \mathcal{} n Yes Insertion When using a self-balancing binary search tree
Cycle sort  \mathcal{}  n^2  \mathcal{}  n^2 \mathcal{} {1} No Insertion In-place with theoretically optimal number of writes
Selection sort  \mathcal{}  n^2  \mathcal{}  n^2  \mathcal{}  n^2 \mathcal{} {1} No Selection Its stability depends on the implementation. Used to sort this table in Safari or other Webkit web browser [2].
Bubble sort \mathcal{} n \mathcal{} n^2 \mathcal{} n^2 \mathcal{} {1} Yes Exchanging Tiny code
Merge sort \mathcal{} {n \log n} \mathcal{} {n \log n} \mathcal{} {n \log n} Depends Yes Merging Used to sort this table in Firefox [3].
Quicksort \mathcal{} n \log n \mathcal{} n \log n \mathcal{} n^2 \mathcal{} \log n Depends Partitioning Can be implemented as a stable sort depending on how the pivot is handled. Naïve variants use \mathcal{O} \left( n \right) space

Saturday, November 13, 2010

Quotes




  • "If I asked my customers what they wanted, they'd have said a faster horse." Henry Ford
  • "If you can't see the future, you won't have one." Noah Everett
  • "People often overestimate what will happen in the next two years and underestimate what will happen in ten." Bill Gates
  • "I have had all of the disadvantages required for success." Larry Ellison 
  • "There is no point in starting your own business unless you do it out of a sense of frustration." R. Branson
  • "Il y a trois manières de se ruiner: le jeu, les femmes — et les ingénieurs. Les deux premières sont plus agréables — mais la dernière est plus sûre." Rothschild
  • "You have got to find a controversial strategy. The more controversial, the better. That’s the way to differentiate yourself from everybody else. Then you've got to get really good at what you’re doing. And that’s how you will beat the competition!" Scott Mc Neally
  • "Fire kept us warm and cooked our food but also burnt down our houses. Every technology has had its promise and peril." Ray Kurzweil
  • "On regrette de ne pas avoir fait, on ne regrette pas d'avoir fait" OH
  • "The great opportunities come when your business idea isn’t as much about the product but is a different view of the industry,"  Capital One Founder, Chairman, and CEO Rich Fairbank
  • "If I were to awaken after having slept for a thousand years, my first question would be: Has the Riemann hypothesis been proven?"  D. Hilbert (Quoted in Mathematical Mysteries : The Beauty and Magic of Numbers (1999) by Calvin C. Clawson, p. 258)
  • « Je suis dans l’œil du cyclone, il n’y a plus de ciel, tout est amalgame, il n’y a que des montagnes d’eau autour de moi », dernier message  de Alain Colas
  • "Listen, invent, personalize"  Jeff Bezos
  • "What do you want to accomplish in the 12 coming months ?"  Me
  • "it should not be the user that is searching for news/products, but the news/product that is coming to the user" Taboola
  • "It has been my experience that folks who have no vices have very few virtues."  Abraham Lincoln
  • "A computer program is said to learn from experience E with respect to some class of tasks T and performance measure P if its performance at tasks in T, as measured by P, improves with experience E." "   Tom M. Mitchell. 
  • "A man is but the product of his thoughts; what he thinks, he becomes" ( By Mahatma Gandhi)
  • "Simplicity is the ultimate sophistication" (Leonardo da Vinci, repeated by Steve Jobs)
  • "Jerrold Zacharias, my mentor, told me "you are not as stupid as you look", and it is important that people tell you that" Rainer Weiss (nobel price in physics).
  • "Quand les hommes ne peuvent changer les choses, ils changent les mots" Jean Jaures
  • O Breizh, ma Bro, me 'gar ma Bro
  • "Dire fait rire, faire fait taire". Jean Le Cam
  • "La vie a plus d'imagination que toi"   mère de Najat Vallaud-Belkacem
  • "n’attendez pas que ça change si vous continuez à faire la même chose tous les jours" Ophely Winter
  • "Ton devoir réel est de sauver ton rêve" Modigliani
  • "Optimism is an essential ingredient of innovation. How else can the individual welcome change over security, adventure over staying in safe places" Robert Noyce
  • "il y a ceux qui voudraient bien, ceux qui veulent, et enfin ceux qui veulent absolument" Bernard Tapie
  • "The greater danger for most of us lies not in setting our aim too high and falling short; but in setting our aim too low, and achieving our mark." Michelangelo
  • "I always invest in companies that can be managed by stupid people, because one day or another that happens" Warren Buffet
  • "“Le bonheur est souvent la seule chose qu'on puisse donner sans l'avoir et c'est en le donnant qu'on l'acquiert.” Voltaire
  • "le bateau à voile est le moyen le plus cher d'aller qq part gratuitement"
  • "Television is programs around advertisement" Sylvio Berlusconi
  • sous le 40eme degré, il n'y a plus de loi, sous le 50eme il n'y a plus de dieu (40eme rugissant, 50eme hurlant)
  • “Logic will get you from A to B. Imagination will take you everywhere.” –Albert Einstein
  • "Pour fonder une cité, il faut forger des mythes" Platon
  • "What we make stands testament to who we are" Jony Ive
  • "La pensée n’est qu’un éclair au milieu de la nuit. Mais c’est cet éclair qui est tout." Henri Poincaré
  • Tuesday, October 26, 2010

    Design Patterns

    • Creational patterns
    • Abstract Factory
      Builder
      Factory method
      Prototype
      Singleton ( + Double-Check Singleton )

    • Structural patterns
    • Adapter
      Bridge
      Composite
      Decorator
      Facade
      Flyweight
      Proxy

    • Behavioral patterns
    • Chain of responsibility
      Command
      Interpreter
      Iterator
      Mediator
      Memento
      Observer
      State
      Strategy
      Template method
      Visitor

    Tuesday, September 21, 2010

    ovh google apps

    Erreur du type:

    "Ajouter un champ MX dans la zone DNS"
    "Utilisez la section (email) pour modifier les champs MX"

    Voici comment saisir les données MX:

    Monday, July 5, 2010

    RestEasy: JBoss project

    RestEasy is a JBoss project that helps you build RESTful Web Services. It is JAX-RS compliant (Java API for RESTful Web Services).

    It is designed for JBoss but I am actually using it with tomcat only. It is very easy to use in an Eclipse project. You can use:

    JAX-RS Hello World with RESTEasy
    .

    Monday, June 28, 2010

    Complexity of basic STL containers

    \ . possible implementation insert/remove at the beginning insert/remove at the end find
    vector sequence, key not unique,
    back-insertion
    dynamic array
    (malloc)
    o(n) o(1) o(1) (operator[])
    o(n) (iter or algo)
    list sequence, key not unique doubly-linked list o(1) o(1) o(n) (iter or algo)
    set sorted associative container, key unique sorted tree o(log(n)) o(log(n)) o(log(n))
    map sorted associative container, key unique sorted tree o(log(n)) o(log(n)) o(log(n))
    hash_map hashed associative container, key unique hashmap o(1) o(1) o(1)

    Notes:
    • for insert/remove in list, assumes we have the iterator at the right position
    • no push_back on associative containers
    Ones that I don't use often:
    \ . possible implementation insert/remove at the beginning insert/remove at the end find
    deque sequence, key not unique
    o(n) in the middle
    dynamic array or
    doubly-linked list
    o(1) o(1) o(n)
    slist sequence, key not unique,
    single direction iterator,
    front-insertion
    single-linked list o(1) o(n)
    o(1) if insert_after
    o(n)

  • Sequence container
    1. vector
    2. deque
    3. list
    4. slist
    5. bit_vector

  • Associative containers
    1. set
    2. map
    3. multiset
    4. multimap
    5. hash_set
    6. hash_map
    7. hash_multiset
    8. hash_multimap

  • Container adaptors
    1. stack (LIFO)
    2. queue (FIFO)
    3. priority_queue
    .
  •