# wallabag_entry

title: wallabag.org
url: https://wallabag.org/en
created_at: 2017-08-10 23:18:16
updated_at: 2017-08-10 23:18:16
mimetype: text/html
language: en
domain_name: wallabag.org
preview_picture: https://wallabag.org/user/themes/boxify/img/wallabag_preview.png
http_status: 200
content:
  <div class="container">
          <div class="row">
              <div class="col-md-12">
                                      <div class="col-md-4 feature-1 wp2">
                          
                          <div class="feature-content">
                              
                              <p>wallabag extracts the article's content (and only its content!) and displays it in a comfortable view.</p>
                          </div>
                      </div>
                                      <div class="col-md-4 feature-2 wp2 delay-05s">
                          
                          <div class="feature-content">
                              
                              <p>If you already have an account on Pocket, Readability, Instapaper or Pinboard, you can import your data into wallabag.</p>
                          </div>
                      </div>
                                      <div class="col-md-4 feature-3 wp2 delay-05s">
                          
                          <div class="feature-content">
                              
                              <p>If you're a developer and you want to connect your application to wallabag, we offer you an API. <a href="http://doc.wallabag.org/en/master/developer/api.html">Here is the documentation</a>.</p>
                          </div>
                      </div>
                              </div>
          </div>
      </div>
  <div class="showcase-wrap">
          
          <div class="container">
            <div class="row">
              
              <div class="col-md-6">
                  
  <p>You can use wallabag on your computer, thanks to our web application. But you can also take wallabag everywhere.
  For example, it's possible to save an article on your laptop at work, start to read it on your smartphone in the subway and finish reading it on your ereader in your bed.</p>
                </div>
            </div>
          </div>
        </div>
      <div class="container">
      <div class="row">
        <div class="col-md-12 text-center wp4">
          
  <p><a href="https://www.wallabag.it/en">wallabag.it</a> is the quality service that you need to host wallabag. For only €12 per year, you'll get a quality hosting, a professional support, automatic upgrades and daily backups.</p>
  <p>Try if for free: you'll get a 14-day free trial with no limitation (no credit card information required).</p>
  <p>We also propose offers for companies. <a href="https://www.wallabag.it/en#cta">Contact us if necessary.</a></p>
        </div>
      </div>
    </div>
  <div class="container">
      <div class="row">
        <div class="col-md-12 text-center wp4">
          
  <p>Last release: wallabag 2.2.3 (<a href="https://wallabag.org/en/news/new-release-wallabag-2-2-3">blog post</a>)<br />(md5 checksum: 63f4cc85397fd6db3e0e3d5f3fa11e02)<br />You can download our <a href="https://static.wallabag.org/releases/">previous releases here</a>.</p>
        </div>
      </div>
    </div>


title: wallabag/wallabag
url: https://github.com/wallabag/wallabag
created_at: 2017-08-10 23:18:18
updated_at: 2017-08-10 23:18:18
mimetype: text/html
language: en
domain_name: github.com
preview_picture: https://avatars0.githubusercontent.com/u/4143872?v=4&s=400
http_status: 200
content:
  <h3>
        
        README.md
      </h3><p><a href="https://travis-ci.org/wallabag/wallabag"><img src="https://camo.githubusercontent.com/678ae0b6ed76a31216eed883721071278281cf1d/68747470733a2f2f6170692e7472617669732d63692e6f72672f77616c6c616261672f77616c6c616261672e7376673f6272616e63683d6d6173746572" alt="Build Status" /></a>
  <a href="https://scrutinizer-ci.com/g/wallabag/wallabag/?branch=master"><img src="https://camo.githubusercontent.com/51b9e9a418c82619beb66f037da0ee0fac19da8c/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f77616c6c616261672f77616c6c616261672f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572" alt="Scrutinizer Code Quality" /></a>
  <a href="https://gitter.im/wallabag/wallabag"><img src="https://camo.githubusercontent.com/7d924c483d0d9dff10763921aea2038e660e1252/68747470733a2f2f6261646765732e6769747465722e696d2f67697474657248512f6769747465722e737667" alt="Gitter" /></a></p>
  <p>wallabag is a self hostable application allowing you to not miss any content anymore.
  Click, save and read it when you can. It extracts content so that you can read it when you have time.</p>
  <p>More information on our website: <a href="https://wallabag.org">wallabag.org</a>.</p>
  <p>If you do not have your own server, consider <a href="https://wallabag.it">the wallabag.it hosting solution</a>.</p>
  <p><a href="https://raw.githubusercontent.com/wallabag/logo/master/_default/typo-horizontal/png/sm/logo-typo-horizontal-black-no-bg-no-border-sm.png" target="_blank"><img src="https://raw.githubusercontent.com/wallabag/logo/master/_default/typo-horizontal/png/sm/logo-typo-horizontal-black-no-bg-no-border-sm.png" alt="wallabag logo" /></a></p>
  <p>Please read <a href="http://doc.wallabag.org/en/master/user/installation.html#requirements">the documentation to see the wallabag requirements</a>.</p>
  <p>Then you can install wallabag by executing the following commands:</p>
  <pre>git clone https://github.com/wallabag/wallabag.git
  cd wallabag &amp;&amp; make install
  make run
  </pre>
  <p>Copyright © 2013-2017 Nicolas Lœuillet <a href="mailto:nicolas@loeuillet.org">nicolas@loeuillet.org</a>
  This work is free. You can redistribute it and/or modify it under the
  terms of the MIT License. See the COPYING file for more details.</p>


title: Framabag, un nouveau service libre et gratuit
url: https://framablog.org/2014/02/05/framabag-service-libre-gratuit-interview-developpeur/
created_at: 2017-08-10 23:18:20
updated_at: 2017-08-10 23:18:20
mimetype: text/html
language: fr-FR
domain_name: framablog.org
preview_picture: https://framablog.org/public/_img/framablog/pleinLesPoches.png
http_status: 200
content:
  <div class="pdfprnt-buttons pdfprnt-buttons-post pdfprnt-top-right"><a href="https://framablog.org/2014/02/05/framabag-service-libre-gratuit-interview-developpeur/?print=pdf" class="pdfprnt-button pdfprnt-button-pdf" target="_blank"><img src="https://framablog.org/wp-content/plugins/pdf-print/images/pdf.png" alt="image_pdf" title="View PDF" /></a><a href="https://framablog.org/2014/02/05/framabag-service-libre-gratuit-interview-developpeur/?print=print" class="pdfprnt-button pdfprnt-button-print" target="_blank"><img src="https://framablog.org/wp-content/plugins/pdf-print/images/print.png" alt="image_print" title="Print Content" /></a></div><h2>Une interview de Nicolas, son développeur.</h2>
  <p><em>Il ne vous a sûrement pas échappé que notre consommation de contenus du Web est terriblement chronophage et particulièrement frustrante tout à la fois  : non seulement nous passons beaucoup (trop  ?) de temps en ligne à explorer les mines aurifères de la toile, y détectant pépites et filons, mais nous sommes surtout constamment en manque. Même si nous ne sommes pas dans le zapping frénétique si facilement dénoncé par les doctes psychologues qui pontifient sur les dangers du numérique pour les jeunes cervelles, il nous vient souvent le goût amer de l’inachevé  : pas le temps de tout lire (<a href="http://fr.wiktionary.org/wiki/TLDR" hreflang="fr">TL;DR</a> est devenu le clin d’œil mi-figue mi-raisin d’une génération de lecteurs pressés), pas trop le temps de réfléchir non plus hélas, pas le temps de suivre la ribambelle de liens associés à un article… <br /></em></p>
  <p><em>Pour nous donner bonne conscience, nous rangeons scrupuleusement un marque-page de plus dans un sous-dossier qui en comporte déjà 256, nous notons un élément de plus dans la toujours ridiculement longue toudouliste, bref nous remettons à plus tard, c’est-à-dire le plus souvent aux introuvables calendes grecques, le soin de lire vraiment un article jugé intéressant, de regarder une vidéo signalée par les rézossocios, de lire un chapitre entier d’un ouvrage disponible en ligne…<br /></em></p>
  <p><em>Alors bien sûr, à défaut de nous donner tout le temps qui serait nécessaire, des solutions existent pour nous permettre de «  lire plus tard  » en sauvegardant le précieux pollen de nos butinages de site en site, et d’en faire ultérieurement votre miel  ; c’est bel et bon mais les ruches sont un peu distantes, ça s’appelle le cloud (nos amis techies m’ont bien expliqué mais j’ai seulement compris que des trucs à moi sont sur des machines lointaines, ça ne me rassure pas trop) et elles sont souvent propriétaires, ne laissant entrer que les <span style="text-decoration: line-through;">utilisateurs</span> consommateurs payants et qui consentent à leurs conditions. Sans compter que de gros bourdons viennent profiter plus ou moins discrètement de toutes ces traces de nous-mêmes qui permettent de monétiser notre profil  : si je collecte sur ces services (ne les nommons pas, justement) une série d’articles sur l’idée de Nature chez Diderot, je recevrai diverses sollicitations pour devenir client de la boutique Nature &amp; Découverte du boulevard Diderot. Et si d’aventure les programmes de la NSA moulinent sur le service, je serai peut-être un jour dans une liste des militants naturistes indésirables sur les vols de la PanAm (je ne sais plus trop si je plaisante là, finalement…)<br /></em></p>
  <p><em>La bonne idée  : «  se constituer un réservoir de documents sélectionnés à parcourir plus tard  » appelait donc une autre bonne idée, celle d’avoir le contrôle de ce réservoir, de notre collection personnelle. C’est Nicolas Lœuillet, ci-dessous interviewé, qui s’y est collé avec une belle application appelée euh… oui, appelée Wallabag. <br /></em></p>
  <p><em>Framasoft soutient d’autant plus son initiative qu’<a href="https://framablog.org/index.php/post/2014/01/31/Geektionnerd-Wallabag" hreflang="fr">on lui a cherché des misères pour une histoire de nom</a> et qu’il est possible d’installer soi-même une copie de Wallabag sur son propre site.<br /></em></p>
  <p><em>Le petit plus de Framasoft, réseau toujours désireux de vous proposer des alternatives libératrices, c’est de vous proposer (sur inscription préalable) un accès au Framabag, autrement dit votre Wallabag sur un serveur Frama* avec notre garantie de confidentialité. Comme pour le Framanews, nous vous accueillons volontiers dans la limite de nos capacités, en vous invitant à vous lancer dans votre auto-hébergement de Wallabag.<br />
   Cet article est trop long  ? Mettez-le dans <a href="http://www.framabag.org/index.php" hreflang="fr">votre Framabag</a> et hop.<br /></em></p>
  <p><em>Framablog  : Salut Nicolas… Tu peux te présenter brièvement  ?<br /></em></p>
  <p>Salut  ! Développeur PHP depuis quelques années maintenant (10 ans), j’ai voulu me remettre à niveau techniquement parlant (depuis 3 ans, j’ai pas mal lâché le clavier). Pour mes besoins persos, j’ai donc créé un petit projet pour remplacer une solution propriétaire existante. Sans aucune prétention, j’ai hébergé ce projet sur Github et comme c’est la seule solution <em>open source</em> de ce type, le nombre de personnes intéressées a augmenté …</p>
  <p><em>Les utilisateurs de services Framasoft ne le savent pas forcément, mais tu as déjà pas mal participé à la FramaGalaxie, non  ?<br /></em></p>
  <p>En effet. J’ai commencé un plugin pour Framanews, <a href="https://github.com/nicosomb/ttrss-purge-accounts" hreflang="fr">ttrss-purge-accounts</a>, qui permet de nettoyer la base de données de comptes plus utilisés. Mais ce <em>plugin</em> a besoin d’être terminé à 100 % pour être intégré au sein de Framanews (et donc de Tiny Tiny RSS), si quelqu’un souhaite m’aider, il n’y a aucun souci. <br />
   J’ai aussi fait 1 ou 2 apparitions dans des traductions pour Framablog. Rien d’extraordinaire, je ne suis pas bilingue, ça me permet de m’entraîner. </p>
  <p><em>Parlons de suite de ce qui fâche  : ton application Wallabag, elle s’appellait pas “Poche”, avant  ? Tu nous racontes l’histoire  ?<br /></em></p>
  <p>Euh en effet … Déjà, pourquoi <em>poche</em>  ? Parce que l’un des trois «  ténors  » sur le marché s’appelle <em>Pocket</em>. Comme mon appli n’était destinée qu’à mon usage personnel au départ, je ne me suis pas torturé bien longtemps. </p>
  <p>Cet été, on a failli changer de nom, quand il y a eu de plus en plus d’utilisateurs. Et puis on s’est dit que poche, c’était pas mal, ça sonnait bien français et puis avec les quelques dizaines d’utilisateurs, on ne gênerait personne. </p>
  <p>C’est sans compter avec les sociétés américaines et leur fâcheuse manie de vouloir envoyer leurs avocats à tout bout de champ. Le 23 janvier, j’ai reçu un email de la part du cabinet d’avocats de Pocket me demandant de changer le nom, le logo, de ne plus utiliser le terme “read-it-later” («  lisez le plus tard  ») et de ne plus dire que Pocket n’est pas gratuit (tout est parti d’<a href="https://twitter.com/wallabagapp/status/423786365944225792" hreflang="fr">un tweet</a> où je qualifie Pocket de «  non free  » à savoir non libre). Bref, même si je semblais dans mon droit, j’ai quand même pris la décision de changer de nom et Wallabag est né, suite aux <a href="http://framadate.org/studs.php?sondage=llcp6ojpyc9pklha" hreflang="fr">dizaines de propositions de nom reçues</a>. C’est un mélange entre le wallaby (de la famille des kangourous, qui stockent dans leur poche ce qui leur est cher) et <em>bag</em> (les termes sac / sacoche / besace sont énormément revenus). Mais maintenant, on va de l’avant, plus de temps à perdre avec ça, on a du pain sur la planche.<br /><img src="https://framablog.org/public/_img/framablog/wallaby_baby.jpg" alt="wallaby avec bébé dans sa poche" title="wallaby avec bébé dans sa poche" /> crédit photo <a href="http://www.flickr.com/photos/26782864@N00/5027202234/in/photolist-8EeJ5A-h1TL6v-NEL81-cnNkSo-9YM1tv-7Kcg6b-8zpAoa-a1ZLMN-9YM39r-7h5SAD-8EeHfL-8EeFwu-dtVwnM-8uoME1-JEzXe-Gq4qy-92VJPR-Cxe1v-8H3D2J-a1ZFNs-9Y72K6-8EeGxL-5L53Fx-5NkENs-5U8CTY-5Nkssh-nkavF-9CrgwP-7sdCAa-duf2Kh-hZepzy-hZdU1e-hZeofF-hZekDg-hZegAY-hZeMZn-jaHgAf-8P87D2-5NgqRv-aT48QB-hZdV4Y-hZeC64-ERgps-5VYGGd-5VYJB1-5NkrFk-6Jxh7h-7h9PuQ-ERfMx-h1U1ih-h1USBx" hreflang="en">William Warby</a> qui autorise explicitement toute réutilisation. </p>
  <p><em>Bon, alors explique-moi ce que je vais pouvoir faire avec Framabag…<br /></em></p>
  <p>Alors Framabag, ça te permet de te créer un compte gratuitement et librement pour pouvoir utiliser Wallabag. Seule ton adresse email est nécessaire, on se charge d’installer et de mettre à jour Wallabag pour toi. Tu peux d’ailleurs profiter <a href="http://www.framasoft.net/#topPgCloud" hreflang="fr">d’autres services proposés par Framasoft ici</a>. </p>
  <p>À ce jour, il y a 834 comptes créés sur Framabag.</p>
  <p><em>Vous avez vraiment conçu ce service afin qu’on puisse l’utiliser avec un maximum d’outils, non  ?<br /></em></p>
  <p>Autour de l’application web, il existe déjà des applications pour smartphones (Android et Windows Phone), des extensions Firefox et Google Chrome. </p>
  <p>Comme Wallabag possède des flux RSS, c’est facile de lire les articles sauvegardés sur sa liseuse (si celle-ci permet de lire des flux RSS). Calibre («  logiciel de lecture, de gestion de bibliothèques et de conversion de fichiers numériques de type ebook ou livre électronique  »,nous dit ubuntu-fr.org) intègre depuis quelques semaines maintenant la possibilité de récupérer les articles non lus, pratique pour faire un fichier ePub  !</p>
  <p>D’autres applications web permettent l’intégration avec Wallabag (FreshRSS, Leed et Tiny Tiny RSS pour les agrégateurs de flux). L’API qui sera disponible dans la prochaine version de Wallabag permettra encore plus d’interactivité. </p>
  <p><em>Y a-t-il un mode de lecture hors ligne ou est-ce que c’est prévu pour les prochaines versions  ?<br /></em></p>
  <p>Il y a un pseudo mode hors ligne, disponible avec l’application Android. On peut récupérer (via un flux RSS) les articles non lus que l’on a sauvegardés. Une fois déconnecté, on peut continuer à lire sur son smartphone ou sa tablette les articles. Par contre, il manque des fonctionnalités  : quand tu marques un article comme lu, ce n’est pas synchronisé avec la version web de Wallabag. J’espère que je suis presque clair dans mes explications. </p>
  <p>Pour la v2, qui est déjà en cours de développement, où je suis bien aidé par Vincent Jousse, on aura la possibilité d’avoir un vrai mode hors ligne. </p>
  <p><em>Alors si on veut aider / participer / trifouiller le code / vous envoyer des retours, on fait comment  ?<br /></em></p>
  <p>On peut aider de plusieurs façons  :</p>
  <ul><li>utiliser wallabag et nous remonter les problèmes rencontrés  ;</li>
  <li>participer au développement de l’application https://github.com/wallabag/wallabag Si Silex / Symfony2 / HTML5 / etc. te parlent, n’hésite pas  !</li>
  <li>comme tout projet, le gros point noir est le manque de documentation. <a href="http://doc.wallabag.org" hreflang="fr">Elle est dispo ici</a> mais il manque plein de choses et tout n’est pas à jour  ;</li>
  <li>parler de Wallabag autour de vous  ;</li>
  <li>il existe <a href="https://flattr.com/thing/1265480/poche-a-read-it-later-open-source-system" hreflang="en">un compte Flattr</a>.</li>
  </ul><p><em>Le mot de la fin… ?<br /></em></p>
  <p>Merci à Framasoft d’accueillir et de soutenir Wallabag  !</p>
  <p>La route est encore bien longue pour ne plus utiliser de solutions propriétaires, mais on devrait y arriver, non  ?</p>
  <p><img src="https://framablog.org/public/_img/framablog/pleinLesPoches.png" alt="framasoft plein les poches" title="framasoft plein les poches" /><br /><a href="http://framalab.org/gknd-creator/" hreflang="fr">hackez Gégé  !</a></p>
  <div title="Diaspora*" id="diaspora-button-container"><a href="denied:javascript:(function(){var url = 'https://framablog.org/2014/02/05/framabag-service-libre-gratuit-interview-developpeur/' ;var title = 'Framabag, un nouveau service libre et gratuit';   window.open('https://framablog.org/wp-content/plugins/share-on-diaspora/new_window.php?url='+encodeURIComponent(url)+'&amp;title='+encodeURIComponent(title),'post','location=no,links=no,scrollbars=no,toolbar=no,width=620,height=400')})()"><img id="diaspora-button-ownimage-img" src="https://framablog.org/wp-content/uploads/2015/01/diaspora.jpg" alt="" /></a></div><div class="twoclick_social_bookmarks_post_531 social_share_privacy clearfix 1.6.4 locale-fr_FR sprite-en_GB"><div class="twoclick-js"><div id="author-bio-box"><h3><img alt="" src="https://framablog.org/wp-content/uploads/2016/11/avatar_user_14_1477988386-70x70.jpg" class="avatar pull-left media-object avatar-70 photo" height="70" width="70" /></h3></div><p class="bio-description">je lis des livres et mange des nouilles.</p></div></div>


title: Prenez soin de vos cuys - Korben
url: https://korben.info/prenez-soin-de-vos-cuys.html
created_at: 2017-08-10 23:18:21
updated_at: 2017-08-10 23:18:21
mimetype: text/html
language: fr-FR
domain_name: korben.info
http_status: 200
content:
  <div class="post-thumbnail"><p class="image"><img class="presentation size-full aligncenter" title="Prenez soin de vos cuys" src="https://korben.info/wp-content/uploads/2014/11/tmp_6185-img_20141127_1153161544457465.jpg" alt="Prenez soin de vos cuys" width="650" height="200" /></p></div><div class="post-content"><p>Parce que cette <a href="https://www.amazon.fr/dvd-blu-ray-films/b/ref=as_li_ss_tl?_encoding=UTF8&amp;camp=1642&amp;creative=19458&amp;linkCode=ur2&amp;node=405322&amp;tag=amazon03abc-21">vidéo</a> est drôle mais aussi parce que c'est un sujet important, je me permets de la relayer ici.</p><iframe src="https://player.vimeo.com/video/112061208" width="500" height="281" frameborder="0" allowfullscreen="allowfullscreen"> </iframe><p>Vous ne regarderez plus vos cochons d'inde de la même manière maintenant. Lol.</p></div><p><img src="https://korben.info/wp-content/uploads/2017/06/tnj4p1myre1mpff12w4j1llndmc.png" width="20px" height="20px" alt="" /><strong><a href="https://bitly.com/2wpUvQK" target="_blank" rel="noopener">PIX - LINK LV - AC05 WiFi Repeteur/Router</a></strong></p><div style="text-align: center;"><a href="https://bitly.com/2wpUvQK" target="_blank" rel="noopener"><img class="overflowing alignnone" src="https://gloimg.gearbest.com/gb/pdm-product-pic/Distribution/2017/06/15/goods-img/1499449267932384345.jpg" alt="" width="300px" height="250px" /></a></div><p><strong><a href="https://bitly.com/2wpUvQK" target="_blank" rel="noopener"> 29,17 € </a></strong></p><p><strong>Soldes et Bons Plans pour la Rentrée scolaire 2017 : livres, fournitures, cartables, ordinateurs, vêtements ... ... </strong><a href="https://bitly.com/2wDEmq0" target="_blank"><strong>Voir la liste des produits</strong></a></p><p>L'amplificateur de gamme PIX-LINK LV-AC05 WiFi vous permet de rester en ligne tout le temps, peu importe ce que vous faites.Quatre antennes externes, deux bandes de support et fonction WPS automatique se combinent pour rendre votre WiFi plus rapide que jamais et plus facile à paramétrer.L'appareil est au dernières normes WiFi /a et est rétrocompatible avec tous vos périphériques 802.11b / g / n.</p><p>Il permet à votre routeur de se connecter à de nombreux périphériques à la fois, et une connexion intelligente s'assure que chacun possède la connexion la plus forte possible.Sa technologie Wi-Fi avancée, le LV-AC05 crée un WiFi puissant qui couvre jusqu'à 100m.</p><p><img src="https://korben.info/wp-content/uploads/2017/06/tnj4p1myre1mpff12w4j1llndmc.png" alt="" width="px" height="px" /><strong><a href="https://bitly.com/2wpUvQK" target="_blank" rel="noopener">En Savoir + </a></strong></p><br />


title: L'économie du vélo, c'est 650.000 emplois en Europe
url: https://www.consoglobe.com/ecomomie-du-velo-en-europe-cg
created_at: 2017-08-10 23:18:24
updated_at: 2017-08-10 23:18:24
mimetype: text/html
domain_name: www.consoglobe.com
preview_picture: https://www.consoglobe.com/wp-content/uploads/2014/11/cyclisme-europe.jpg
http_status: 200
content:
  <p>Avec l’avènement des modes de transport “doux” et moins polluants, le vélo connaît un regain de forme spectaculaire, notamment dans certains pays comme le Danemark ou les Pays-Bas, mais pas uniquement. A l’échelle de l’Union européenne, ce sont 650.000 emplois qui sont créés dans l’économie du vélo !</p><div class="flexible-content-body">
  <p>C’est le résultat surprenant de la première étude exhaustive des emplois créés par la filière Vélo en Europe. Pour mémoire, l’acier ce n’est plus que 350 000 personnes en Europe (le reste a filé en Asie) et les industries extractives représentent 615 000 emplois.</p>
  <p>Ainsi environ 655 000 personnes doivent leur travail à l’économie de cyclisme : la filière est en effet riche et comprend de multiples métiers de la conception des cycles, la fabrication des vélos, le commerce, le tourisme ou encore les infrastructures (pensez aux réseaux de vélos en libre service VLS).</p>
  <p><img class="aligncenter size-full wp-image-212292" src="https://www.consoglobe.com/wp-content/uploads/2014/11/federation-cycliste-europeenne.jpg" alt="federation-cycliste-europeenne" width="600" height="104" /></p>
  <h3>L’économie du vélo : un gros potentiel</h3>
  <p>Pourtant la part du cyclisme dans les transports en Europe n’est que de 3 %. Mais cela n’empêche pas les rédacteurs d’une étude sur le secteur d’espérer <strong>doubler les effectifs employés d’ici 2020</strong> pour atteindre plus d’un million d’emplois.</p>
  <p>Ci-dessous, l’usage du vélo dans la population des pays européens</p>
  <p><a href="https://www.consoglobe.com/wp-content/uploads/2014/11/usage-cyclisme-pays-europe.jpg"><img class="aligncenter size-full wp-image-212291" src="https://www.consoglobe.com/wp-content/uploads/2014/11/usage-cyclisme-pays-europe.jpg" alt="usage-cyclisme-pays-europe" width="600" height="206" /></a></p>
  <p>Kevin Mayne, le directeur du développement de la <a href="http://www.ecf.com/industry/why-join/">Fédération des cyclistes européen</a>s, commanditaire de l’étude, veut faire passer un  message très simple aux gouvernements et aux autorités locales :</p>
  <p>«V<em>ous savez que l’investissement dans le cyclisme se justifie pleinement en matière de transports, notamment à cause du <a title="changement climatique" href="https://www.consoglobe.com/zoom-rechauffement-climatique-2876-cg">changement climatique</a> et des budgets santé qui explosent du fait de la pollution</em>.</p>
  <p><em>Il est désormais clair que chaque nouvelle piste cyclable que vous construisez et chaque nouveau cycliste vous créez contribuent à créer de l’emploi. Investir dans le cyclisme offre un meilleur rendement économique que toute autre option de transport. Cela devrait être votre premier choix</em>».</p>
  <ul><li><strong>Le saviez-vous</strong> ? Début 2012, il y avait en Europe 400 dispositif de vélo en libre service</li>
  </ul><h3>L’économie du vélo pour la transition écologique</h3>
  <p>Dans le virage vers une économie décarbonée, le rapport montre  que le vélo est un outil pour créer une économie verte. Julian Scola, un porte-parole de la Confédération européenne des syndicats a déclaré soutient qu’il faut  « investir dans différents types d’infrastructures de transport, comme le vélo.”</p>
  <p>La filière vélo est donc à bien plus forte intensité d’emplois que l’on ne le pensait et nettement plus que toute autre mode de transport. Le potentiel de création d’emplois du secteur parait donc très bon et, c’est étonnant, plus important que celui du secteur automobile qui,, emploie trois fois moins de personnes par million d’euros de chiffre d’affaires.</p>
  <h3>Le gisement du tourisme à deux roues</h3>
  <p>Le plus gros<strong> gisement d’emplois</strong> se trouve dans le cyclo-tourisme – et notamment dans l’hébergement et la restauration qui y est liée – qui emploie déjà 524 000 personnes. La fédération européenne des cyclistes aimerait que l’Europe réserve 10 % de son budget transport pour l’économie du vélo et le soutien aux innovations (les e-bikes) et les infrastructures.</p>
  <p><strong>Autre avantage</strong> de l’économie du vélo, ses emplois sont géographiquement plus stables que d’autres secteurs, et offrent un marché du travail plus ouvert aux personnes peu qualifiées. Et, conséquence positive, la capacité d’entraînement de l’économie du cycle sur le tissu économique local est meilleure que celle d’autres modes de transports (comme l’automobile, plus complexe). Pourquoi ?</p>
  <p>Parce que “les cyclistes vont plus dans les commerces locaux, les restaurants, les cafés que les utilisateurs d’autres modes de transport», confirme l’étude ; Non seulement le vélo, c’est bon pour la santé et l’environnement mais c’est aussi bon pour l’économie. En selle !</p>
  <p>*</p>
  <p><a title="écomobilité" href="https://www.consoglobe.com/pg-ecomobilite">Le dossier écomobilité</a></p>
  <p><a title="S'ouvre dans une nouvelle fenêtre" href="https://www.consoglobe.com/bien-choisirvelo-electrique-cg">Guide d’achat : Bien choisir un vélo électrique</a></p>
  <p>
  <a title="S'ouvre dans une nouvelle fenêtre" href="https://www.consoglobe.com/bien-choisirvelo-electrique-cg"><img class="aligncenter" src="https://www.consostatic.com/wp-content/uploads/2013/11/guide-velo-electrique-210x702.jpg" alt="guide-velo-electrique-" width="210" height="70" /></a></p>
  </div>


title: 13 excellentes raisons de quitter son job en 2014
url: https://mrmondialisation.org/13-excellentes-raisons-de-quitter-son-job-en-2014/
created_at: 2017-08-10 23:18:27
updated_at: 2017-08-10 23:18:27
mimetype: text/html
language: fr-FR
domain_name: mrmondialisation.org
http_status: 200
content:
  <div class="td-post-featured-image"><img width="696" height="423" class="entry-thumb" src="https://i0.wp.com/mrmondialisation.org/wp-content/uploads/2014/11/Haydée-vélo-tête-rigolote-e1416867378142.jpg" alt="" title="Haydee" /></div><p class="title"><a title="Articles par Haydée" href="http://www.travelplugin.com/author/haydee/" rel="author">Haydée</a> (en photo) de travelplugin.com est une blogueuse qui ne mâche pas ses mots… Elle partage avec nous son article et propose 13 bonnes raisons de changer de travail en 2014 !</p>
  <p>Tel des chats d’appartement, <strong>nous pouvons rester cloîtrés chez nous toute une vie</strong> sans jamais appréhender le monde qui nous entoure. Et bien il en va de même avec notre travail.</p>
  <p>La pression sociale ne nous définit plus que par notre emploi. Formatés par cette idée de vivre pour travailler, nous devenons de dociles petits soldats de l’économie.</p>
  <p><strong>Mais le bon soldat aussi à besoin de se rebeller.</strong> Surtout quand il s’agit de donner un sens à son existence :</p>
  <blockquote><p><em>J’ai un job bien payé mais mon âme est malheureuse… Ce n’est pas moi ! D’autant que mon titre n’est que subjectif. Au fond je me sens inutile.</em></p></blockquote>

  <p>Il y a quelques années, j’ai lâché le monde de l’entreprise. Aujourd’hui je pars vivre en Hongrie avec des projets longuement mûris prêts à être déployés. Tant pis si c’est risqué.</p>
  <p>Nous n’avons rien sans rien et j’aime le risque.</p>
  <p>Et nous sommes loin d’être les seuls ! Comme en témoigne le parcours de ce <strong><a title="Travailler et voyager en continu – Un cas concret" href="http://www.travelplugin.com/travailler-voyager-en-continu-cas-concret/">couple qui travaille et voyage en continu</a></strong>.</p>
  <p>Alors si comme moi vous rêvez de vous accomplir sans bosser pour un autre, j’ai 13 arguments qui vous aideront peut-être à quitter votre job.</p>

  <h2>1. Chaque matin vous partez au travail à reculons</h2>
  <p><strong>Tous les jours de votre misérable existence sont régis par cet impératif routinier.</strong> Vous ne pouvez plus piffrer vos collègues ni votre directeur. Vous en faite même une obsession telle que cela affecte votre santé et vos relations.</p>
  <p><strong>Et si votre angoisse était plutôt due à un profond ennui ? Signe que vous n’apprenez plus.</strong></p>
  <p>Peut-être êtes-vous sur la pente descendante ou que votre ultime promotion vous a parachuté sur le poste inadéquat ? Si comme l’explique le principe de Peter, chaque employé tend à s’élever à son niveau d’incompétence, vous persistez peut-être dans la mauvaise voie.</p>
  <p>Vous voulez que je vous fasse un dessin ? <img class="wp-image-11740 aligncenter" src="http://www.travelplugin.com/wp-content/uploads/2014/06/28-ans-2en1-430x602.jpg" alt="28-ans-2en1" width="354" height="496" /> Après 3 ans de lycée et quelques années d’université pour travailler dans le domaine qui vous a été enseigné, comme 90% des gens vous finirez par vous dire cette phrase fatale :</p>
  <blockquote><p>C’était les 45 ans les pires de ma vie…</p></blockquote>
  <p>Car la plupart des travailleurs n’aiment pas ce qu’ils font.</p>
  <p><strong>Et que fait-on de ce que l’on déteste ? On s’en débarrasse !</strong> Comme la peur ; la peur de quitter son job face à un taux de chômage record. La peur de se retrouver à la rue comme un misérable.</p>
  <p>Alors que préparer correctement son départ suffit à l’oublier.</p>

  <h2>2. Votre boulot ne satisfait plus vos besoins</h2>
  <p>Et selon Maslow vous en avez pas mal :</p>
  <p><img class="wp-image-11742 aligncenter" src="http://www.travelplugin.com/wp-content/uploads/2014/06/pyramide-maslow-hs-travail.png" alt="pyramide-maslow" width="668" height="467" /></p>
  <p><strong>Sont-ils satisfaits ?</strong></p>
  <p>Côté physiologique et sécurité, oui. A moins que vous ne soyez payés au lance-pierre dans un atelier du Bangladesh. De même avec le besoin d’appartenance, excepté pour les têtes de con reléguées au placard.</p>
  <p><strong>L’accomplissement de soi et l’estime des autres sont beaucoup plus difficiles à combler.</strong></p>
  <p>Pour ma part ils l’étaient tant que je disposais d’une totale liberté sur la gestion de mes tâches. J’automatisais tout ce que je pouvais au sein des entreprises pour me dégager du temps et faire autre chose. Reconnue par mes paires, <strong>ma créativité battait son plein jusqu’à l’arrivée fatale de la routine.</strong></p>
  <p>Mais j’ai aussi connu l’insatisfaction.</p>
  <p>A passer ma vie au turbin avec des personnes détestables, dans des usines à gaz bâillonnant ma créativité. Dans ces cas là je trouvais très vite une stratégie de sortie !</p>
  <p>Vous bloquez aux deux derniers paliers ? Pire, ça coince déjà au troisième ? Commencez dès maintenant à réaliser des choses en parallèle de votre taf ou cassez-vous de votre entreprise.</p>
  <p><strong>Plus vous satisferez de besoins, plus vous créerez les conditions idéales d’abondance pour votre avenir.</strong> Vous pouvez arguer que  » tout le monde n’a pas de tels besoins « . Dire le contraire serait vous résigner face à vos manques.</p>

  <h2><img class="alignright size-full wp-image-11746" src="http://www.travelplugin.com/wp-content/uploads/2014/06/Patron.jpg" alt="Patron" width="279" height="700" />3.Votre boss vous donne de l’urticaire</h2>
  <p><strong>C’est fou le nombre de petits chefs prêts à vous écraser</strong> pour satisfaire leurs besoins d’estime. Pour prouver sa valeur, il est plus facile de dénigrer que de s’améliorer.</p>
  <p>Ajoutez à cela toutes leurs frustrations qu’ils vous font payer, bien qu’elles soient identiques aux vôtres. Et vous savez pourquoi vous, comme la majorité des employés, n’aimez pas votre patron.</p>
  <p>Pester contre lui en famille et crier vengeance vous soulage… Mais pas ceux qui vous accompagnent. Et ça vous mine ! Car <strong>vous côtoyez votre boss plusieurs heures par jour, voir même plus que votre conjoint(e)</strong>.</p>
  <p>En restant dans une telle relation vous dépérirez et plomberez votre smala. Alors pas de petites vengeances ni de complaintes, pensez à votre construction.</p>
  <p>Et si vos relations inter-collègues sont identiques c’est pareil.</p>

  <h2>4. Votre sécurité d’emploi est une chimère</h2>
  <p>Vous pensez qu’en obtenant un job dans une grosse boite vous grimperez les échelons et serez promus à votre juste valeur jusqu’à votre retraite. Prétention bien légitime avec vos 70 heures de boulot assidu par semaine.</p>
  <p>Mais est-ce toujours d’actualité ?</p>
  <p><strong>J’ai un scoop pour vous : La sécurité d’emploi n’a jamais existé !</strong></p>
  <p>Et ça n’ira pas en s’améliorant avec la dégradation constante du marché du travail. Pas une semaine ne passe sans que de nouveaux plans sociaux de grandes entreprises ne soient annoncés.</p>
  <blockquote><p>Les PDG ont gardé les millions d’€ et ont viré des milliers de personnes pour délocaliser en Chine.</p></blockquote>
  <p>Vous avez déjà entendu ce genre de propos non ? Dites merci aux licenciements économiques.</p>
  <p><strong>La sécurité d’emploi est un mythe à moins de vouloir travailler pour la SNCF.</strong></p>

  <h2>5. Vous avez été remplacé</h2>
  <p>Substitué par les machines depuis des années, l’employé d’antan fait face à un autre problème :<strong> Les services vendus par à-coups.</strong> Quand un gourou du web comme Seth Godin nous dit :</p>
  <blockquote><p>Pourquoi engager des gens médiocres en CDI lorsqu’on peut engager des pointures temporairement ?</p></blockquote>
  <p>Vous croyez qu’il est le seul à le penser ?</p>
  <p><strong>La technologie, <a title="Permettant de travailler de n'importe où dans le monde" href="http://www.travelplugin.com/business-ligne-travailler-nimporte-ou-dans-monde/">le travail en ligne</a>, le outsourcing, l’industrie du temporaire et la productivité remplacent tout doucement la classe moyenne.</strong></p>
  <p>Les jobs de la classe ouvrière d’il y a 30 ans n’existent déjà presque plus. Et le vôtre ? Ne risque t-il pas également de disparaître ? Souvenez-vous des années 2000. Les patrons à gros cigares pleuraient :</p>
  <blockquote><p>Comment allons-nous faire pour nous débarrasser de tout nos poids mort ?</p></blockquote>
  <p>Pas de panique ! La crise de 2008 est là. Vous êtes viré et nous n’y pouvons rien, c’est l’économie. Peut-être mais elle s’est redressée depuis…</p>
  <p>Où sont passés les jobs disparus ?</p>
  <p>Mais si vous souhaitez vous secouer c’est peut-être votre chance après tout. <strong>L’homme ne bouge son cul qu’au pied du mur.</strong> Alors prenons ce mal pour un bien.</p>
  <p>Et puis de toute façon…</p>

  <h2>6. Les grandes corporations ne vous aiment pas</h2>
  <p>Vous qui vous êtes dédié des années, voir des décennies à votre entreprise, croyez-vous vraiment qu’elle aura de la reconnaissance pour vous ? Les grandes entreprises vous trompent. Ce sont des machines bien réglées cherchant l’efficacité perpétuelle à faire plus d’argent.</p>
  <p><strong>Ce témoignage m’a déchiré le cœur :</strong></p>
  <blockquote><p>Je dois me libérer ! Je travaille jour après jour comme un fou pour 3 patrons de merde. Je passe devant leur Porsche pendant qu’ils se vantent d’être géniaux parce qu’ils louent des vélos à leurs employés.</p>
  <p>Leurs ingénieurs expérimentés, titulaires de Masters et de doctorats, sont moins payés que les branleurs des relations publiques et des ressources humaines, détenteurs au mieux d’un bac +2. <img class="alignright wp-image-11748 size-medium" src="http://www.travelplugin.com/wp-content/uploads/2014/06/Prison01-430x483.jpg" alt="Prison01" width="430" height="483" /></p>
  <p>Les salaires sont si bas que leurs employés de 35 ans doivent vivre en colocations comme des étudiants.</p>
  <p>Ils vantent leurs actions en bourse alors qu’ils se dévaluent chaque année… et nos salaires en pâtissent au passage.</p>
  <p>Et le PDG dans tout ça ? Il s’en fout il est riche.</p>
  <p>Je ne suis pas né riche moi et tout ce que j’ai à offrir c’est mon doctorat et 50 publications dans des revues scientifiques. Même mon université ne reconnaît ni mon talent ni mon dur labeur…</p>
  <p>Rahhhh ! Cela me donne envie de me tuer ! Je dois me libérer de cette situation inadmissible.</p></blockquote>
  <p><strong>Détruire vos aspirations profondes est une activité récurrente des grandes entreprises.</strong></p>
  <p>Elles créées un environnement dans lequel les gens feront tout pour de l’argent. Elles veulent être mises au devant de la scène en cachant leurs éléments talentueux. Par une promotion peut-être ?</p>
  <p>Elles préfèrent briller en spoliant vos idées. Voler les idées, encore une belle activité d’entreprise.</p>
  <p><strong>Ne gâchez pas votre vie en travaillant pour des voleurs.</strong></p>
  <p>Après 2 ans dans une grosse firme, mon chef direct m’a fait une confidence : En 7 longues années il n’a jamais été augmenté. Je suis partie aussi sec. J’ai du mal avec la vaseline. J’étais pourtant bien avec tout le monde et j’aimais mon environnement de travail…</p>
  <p>Et bien justement ! Tout est calculé pour que ça passe sans broncher.</p>
  <p>Alterner est une bonne option. Commencez avec de petits projets en parallèles et vous vous sentirez mieux, même au sein de votre entreprise.</p>
  <p>Mais n’y restez pas pour autant.</p>

  <h2>7. Votre retraite ? pfff…</h2>
  <p>Vous y croyez encore ? Cotiser pour ses vieux jours c’était le bon vieux temps. L’inflation s’est faite un plaisir de tailler dans le gras avec les années.<br />Sans compter les <strong><a title="Pensez éventuellement à changer de banque aussi" href="http://www.travelplugin.com/face-pire-arnaque-banques-choisissez-moindre/">frais de gestion des banques</a></strong> sur votre plans épargne retraite.</p>
  <p>Et puis quoi ? <strong>Vous allez attendre de tirer profit d’un régime de retraite pour commencer à vivre ?</strong></p>
  <p>Vieux et délabré, vous aurez travaillé des années sur un poste que vous n’aimez pas et tout à coup vous aurez 80 ans ! <a title="" href="http://www.travelplugin.com/wp-content/uploads/2014/06/28-ans-Retraite.jpg" rel="lightbox"><img class="aligncenter wp-image-11743" src="http://www.travelplugin.com/wp-content/uploads/2014/06/28-ans-Retraite-600x266.jpg" alt="28-ans-Retraite" width="629" height="279" /></a> Pas facile de profiter de tout à cet âge. Vérifiez votre pacemaker avant de sauter en parachute. 🙂</p>
  <p><strong>Votre meilleure retraite c’est de la choisir vous-même.</strong> Commencez un projet et ne le lâchez pas. Il n’y a pas d’âge pour monter un business. Certains me diront :</p>
  <blockquote><p>Mais je ne suis pas un entrepreneur.</p></blockquote>
  <p>Tout le monde entreprend tous les jours. Et s’investir dans quelque chose de nouveau ne vous demande pas non plus d’être un Mark Zuckerberg.</p>
  <p>Vos initiatives, vos capacités à développer des idées et à rebondir face à l’échec suffisent. <strong>Essayer, commencer, se planter, c’est ça la vraie aventure de la vie !</strong></p>

  <h2>8. L’argent ne justifie pas tout</h2>
  <p><strong>Dois-je accepter un boulot pour l’argent ou pour l’amour que je lui porte ?</strong> Je suis sûre que cette question vous a déjà traversé l’esprit.</p>
  <p><strong>L’argent c’est comme les croissants.</strong> En manger deux c’est génial ; même trois ou quatre feront l’affaire. Mais vous n’allez pas en avaler quinze. Chaque croissant supplémentaire ne vous procurera pas plus de plaisir. En réalité, si vous deviez tous les manger vous auriez sûrement envie de vomir. <a title="" href="http://www.travelplugin.com/wp-content/uploads/2014/06/Lama-Argent.jpg" rel="lightbox"><img class="aligncenter size-large wp-image-11745" src="http://www.travelplugin.com/wp-content/uploads/2014/06/Lama-Argent-600x447.jpg" alt="Lama-Argent" width="600" height="447" /></a></p>
  <p>Tout le monde veut être libre et tout le monde veut de l’argent pour obtenir cette liberté. Ainsi,<strong> ironiquement, notre culture nous apprend à devenir esclave pour atteindre cette liberté.</strong></p>
  <blockquote><p>Esclave de ma liberté… Je suis perdue là !</p></blockquote>
  <p>Des études sérieuses prouvent qu’une hausse de salaire augmente votre niveau de bonheur de… 0 ! Voilà un début de réponse à notre questionnement. Etre enchaîné toute notre vie dans un zoo nous protège des vicissitudes de la vie, certes. Mais n’est-il pas plus intéressant de traverser la jungle pour<strong> <a title="Tout plaquer à 30 ans pour une vie d'aventures" href="http://www.travelplugin.com/tout-plaquer-pour-vie-aventure-cas-concret/">profiter d’une vie d’aventures ?</a></strong></p>
  <p>De toute façon,<strong> plus l’on gagne plus l’on dépense</strong> : Une nouvelle déco, un nouvel aspirateur ou une machine à laver chaque année. Pourquoi pas la dernière voiture de votre marque préférée tant que vous y êtes ? Et si vous pouviez voir votre maîtresse plus souvent…</p>
  <p>En clair, <strong>la plupart des gens qui gagnent cet argent le mettent rarement de côté.</strong></p>
  <p>Votre niveau de consommation augmente et vous vous demandez en fin de mois :</p>
  <blockquote><p>Mais où est parti tout mon argent ?</p></blockquote>
  <p>Et c’est parti pour vous torturer avec votre future augmentation de salaire qui n’arrivera peut-être jamais.</p>
  <p><strong>STOP ! Vous n’avez pas l’impression de tourner en rond là ?</strong></p>
  <p>Attendre votre prochaine augmentation ne vous amènera jamais à vous libérer de l’anxiété des finances. Seul le temps libre, l’imagination et la créativité vous aideront à vous délivrer de ce rapport à l’argent biaisé par votre boulot.</p>

  <h2>9. L’abondance ne viendra jamais de votre travail</h2>
  <p><strong>Et on ne parle plus de fric là.</strong></p>
  <p>Quand vous vous réveillez tous les jours avec cette motivation de réussir par et pour vous-même, vous soulevez des montagnes. Quand vous prenez plaisir à aider ceux qui vous entourent, même les gens que vous ne connaissez pas, c’est de la reconnaissance que vous obtenez. Et c’est bon pour l’estime de soi.</p>
  <p>N’est-ce pas Monsieur Maslow ?</p>
  <p><strong>Partagez vos richesses avec joie, cela vous sera rendu au centuple. C’est ça l’abondance.</strong> Pas facile à atteindre en restant enchaîné à un boulot qui vous rebute avec toute sa panoplie :</p>
  <p>– Petit chef frustré</p>
  <p>– Augmentations de salaire soporifiques</p>
  <p>– Fausse sécurité d’emploi</p>
  <p>– Hypocrisie de la retraite</p>
  <p>– Bride de votre créativité et j’en passe…</p>
  <p>Mais vous n’y pouvez rien ! Ce sont les mâchoires de l’économie qui vous privent de cette abondance, et nécessité fait loi depuis plus de 100 ans. Difficile à comprendre pour nous qui baignons dedans depuis notre naissance, je vous l’accorde.</p>
  <p><strong>Atteindre l’abondance c’est en prendre conscience et sortir peu à peu de cette prison.</strong></p>

  <h2>10. Vous êtes pris pour un « looser » dans votre entourage</h2>
  <p><strong>Enfermé dans votre job depuis 2 ans vous êtes loin d’exploiter toutes vos capacités. </strong> Quand on vous demande ce que vous faites dans la vie vous avez honte de le dire…</p>
  <p>Ces années vont prendre de l’importance sur votre CV et le mot looser résonnera de plus en plus fort dans votre tête.</p>
  <p><strong>Voilà maintenant 5 ans que vous parlez de vos projets à vos proches.</strong> Et qu’en pensent-ils réellement ? Vous voulez vraiment le savoir ? Demandez-leur mais relativisez les réponses hypocrites.</p>
  <p class="wp-image-11747 size-large">Ou demandez l’avis de personnes vraiment critiques. Vous savez, ces personnes qui disent tout haut ce que tout le monde pense tout bas.</p>
  <p>Ne faites pas l’erreur de vous encroûter en laissant les années défiler. Car plus il y en aura, plus il sera difficile de partir.</p>
  <p>Et frustré à vie <strong>après 15 ans à vous plaindre de votre boite, vous chercherez du réconfort dans les yeux de votre amour</strong> espérant y découvrir le signe qu’il vous aime encore. Mais 15 ans de frustrations ça use, l’étincelle disparait et vous finissez par dormir seul dans la froideur de la nuit.</p>
  <p>Comme un looser.</p>

  <h2>11. Non ! Vous sentez que vous valez mieux</h2>
  <p>Vous pendre ? Jamais. Si vous avez lu cet article en entier il est évident que vous valez mieux que ça. Alors comment faire le premier pas ?</p>
  <p><strong>Il vous faut juste plus de responsabilités, mais pour cela il faut des opportunités.</strong></p>
  <p>Elles sont souvent limitées au sein des entreprises. Du coup, si vous souhaitez élargir vos compétences vous devez passer à autre chose. Ne perdez pas votre temps à faire plaisir à des personnes qui ne vous comprendront jamais.</p>
  <p><strong>Et puis sans défi l’ennui s’installe.</strong></p>
  <p><strong><a title="Condition sine qua non d'un nouveau départ" href="http://www.travelplugin.com/tout-recommencer-a-zero/">Planifiez votre futur au préalable</a></strong>, c’est un premier pas. Ensuite seulement démissionnez ou partez à l’amiable. Vous ne pouvez pas juste partir en disant « fuck » à votre patron. Préparez-vous comme pour un sportif de haut niveau. Les préparations mentales, physiques et émotionnelles sont indispensables.</p>
  <p>Alors ne quittez pas votre chéri(e) au même moment.</p>

  <h2>12. Vous avez 1 000 projets en tête (rédigés c’est mieux…)</h2>
  <p>N’attendez pas pour les entamer !</p>
  <p><strong>Vous pouvez les commencer en parallèle de votre boulot.</strong> C’est le cas de <a title="Google + de Tony : suivez-le !" href="https://plus.google.com/u/0/+TonyFouns/posts">Tony, l’illustrateur de Travelplugin</a>. Il s’est mis à gribouiller sur le blog. Puis à écrire quelques billets. Il a fini par se former à Illustrator et à Photoshop et créer des illustrations pour chaque article du blog.</p>
  <blockquote><p><em>Non il ne dessinait pas au bureau, quoique…</em></p></blockquote>
  <p><strong> Il a travaillé d’arrache-pied tous les soirs en rentrant du taf. </strong>Le dessin et l’illustration sont devenus ses nouveaux hobbies.</p>
  <p>Conjointement, un incroyable calme intérieur l’a envahi au boulot. Les plaintes des employés, les ultimatums de ses chefs et les usagers mécontents n’ont plus eu d’emprise sur lui. Bizarre.</p>
  <p><img class="wp-image-11793 aligncenter" src="http://www.travelplugin.com/wp-content/uploads/2014/06/Un-monsieur-crie-sur-Tony-zen-600x568.jpg" alt="Un monsieur crie sur Tony zen" width="500" height="473" /></p>
  <p><strong>Aujourd’hui il ne pense plus qu’à avancer.</strong> En s’octroyant une année sabbatique et en travaillant pour ce qui le motive. Ou encore en montant son site d’illustrateur pendant notre expatriation dans les pays de l’Est.</p>
  <p>Belle stratégie de sortie que de s’ouvrir l’esprit par la créa et ainsi quitter son job.</p>
  <p><strong> Une stratégie de sortie c’est planifier avant de tout plaquer.</strong></p>
  <p>Et ce n’est pas parce que vous partez que vous allez réussir, ce ne serait pas drôle autrement.</p>
  <p>J’ai fait des erreurs et je continue aujourd’hui, plus expérimentée encore.</p>

  <h2>13. Au bout de 6 mois, vous aurez appris autant qu’en 4 ans</h2>
  <p>Lire, entamer un projet, gagner en aptitudes et faire des erreurs, quoi de mieux pour apprendre. <strong>Le tout est de garder l’esprit en ébullition</strong> en continuant d’apprendre perpétuellement.</p>
  <p>Etudiez, voyagez ou montez des business. Vous devrez appréhender des tonnes de nouvelles compétences ; assez pour remplir une vie. Et le premier chèque perçu est un moment magique. C’est comme si vous aviez appris à créer de l’argent à partir de rien.</p>
  <p>Et je sais de quoi je parle ! Ancienne contrôleuse de gestion je me suis formée au web et suis devenue webmaster, rédactrice et traductrice freelance d’un site reconnu.</p>
  <p>De travailleuse à domicile je suis vite passée<strong> nomade digitale en traversant l’Amérique latine avec mon travail sous le bras.</strong></p>
  <blockquote><p>Nouveau taf + nouveau continent = what else !</p></blockquote>
  <p>C’est la somme de ce que j’ai appris qui me permet de m’expatrier en travailleuse nomade. Mais le plus difficile reste le premier pas. De nombreuses personnes lisent et apprennent beaucoup sans jamais passer à l’action.</p>

  <p><img class="aligncenter size-full wp-image-11749" src="http://www.travelplugin.com/wp-content/uploads/2014/06/Prison02.jpg" alt="Un homme dans une prison ouverte" width="700" height="539" /></p>
  <h2>Il y a tellement d’excuses pour éviter de quitter son job</h2>
  <p>Ouvrez les tiroirs…</p>
  <p>– J’attends l’opportunité mais c’est rare que la chance me tombe dessus.</p>
  <p>– Je n’ai pas de talent. (Dur…)</p>
  <p>– Je n’ai pas d’argent, je n’ai pas de relations et mes parents sont pauvres. Je ne peux donc pas entamer un business,</p>
  <p>– et même si j’en commence un, je n’ai ni bureau ni clients, et de toute façon je suis trop timide pour appeler un client.</p>
  <p>– Je ne peux pas écrire un livre, je n’ai pas de publicateur et que vont penser les gens ?</p>
  <p>– Je suis trop vieux maintenant.</p>
  <p>– Ok mais je veux faire de la création et je ne sais pas par où commencer…</p>
  <p>– J’ai des enfants !</p>
  <p>A toutes ces paroles, je réponds : « Je suis d’accord avec vous ». <strong>Si certaines personnes préfèrent rester en prison avec une porte grande ouverte, je ne vais pas argumenter. </strong></p>
  <p>Vous êtes juste libres d’y rester.</p>
  <hr />
  <p><img src="http://www.travelplugin.com/wp-content/uploads/2012/11/Favicon_Oeil-Lama-16x14.png" alt="" />Lire l’article complet sur <a href="http://www.travelplugin.com/13-excellentes-raisons-de-quitter-son-job/#lightbox/5/" target="_blank">Travelplugin</a></p>

preview_picture:
  https://mrmondialisation.org/wp-content/uploads/2014/11/Haydée-vélo-tête-rigolote-e1416867378142.jpg


title: Chrome Web Store
url: https://chrome.google.com/webstore/category/apps
created_at: 2017-08-10 23:18:27
updated_at: 2017-08-10 23:18:27
mimetype: text/html
language: en
domain_name: chrome.google.com
preview_picture: https://ssl.gstatic.com/chrome/webstore/images/chrome_web_store-128.png
http_status: 200
content:
  wallabag can't retrieve contents for this article. Please <a href="http://doc.wallabag.org/en/master/user/errors_during_fetching.html#how-can-i-help-to-fix-that">troubleshoot this issue</a>.


title: The State Of Animation 2014 – Smashing Magazine
url: https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/
created_at: 2017-08-10 23:18:30
updated_at: 2017-08-10 23:18:30
mimetype: text/html
language: en-US
domain_name: www.smashingmagazine.com
http_status: 200
content:
  <ul class="pmd clearfix"><li class="a">By </li>
  				<li class="rd">November 18th, 2014</li>
  				
  		
  		</ul>
  	<p>The post-Flash era is hardly free of animation. CSS animation is quickly becoming a cornerstone of user-friendly interfaces on mobile and desktop, and JavaScript libraries already exist to handle complex interactive animations. In the wake of so much “CSS versus JavaScript animation” infighting, a new API specifically for web animation is coming out  that might just unite both camps.</p>
  <h3 id="further-reading-on-smashing">Further reading on Smashing: <a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#further-reading-on-smashing" class="sr hsl">Link</a></h3>
  <p>It’s an exciting time for web animation, and also a time of grave miscommunication and misinformation. In 2014, I had the chance to travel the world to talk about <a href="http://www.slideshare.net/CrowChick/animation-and-the-future-of-ux-33573726">using animation in user interfaces and design</a><sup class="po" id="note-8"><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#8">8</a></sup>. I met and interviewed dozens of people who use and champion both CSS and JavaScript. After interviewing so many developers, designers and browser representatives, I discovered a technical and human story to be told.</p>
  <p>What you’re about to read is purely observational and as unbiased an account as you will be able to find on the subject of web animation.</p>
  <h3 id="flash-may-be-gone-but-the-era-of-web-animation-has-just-begun">Flash May Be Gone, But The Era Of Web Animation Has Just Begun <a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#flash-may-be-gone-but-the-era-of-web-animation-has-just-begun" class="sr hsl">Link</a></h3>
  <p>Since the era of Flash, it’s become fashionable to think of animation as little more than decoration, a “flashy” afterthought, often in poor taste, like an unwelcome <code>blink</code> tag. But unless we want to display nothing other than copy on a screen, animation is still very much our friend.</p>
  <p>For <strong>user interface designers</strong>, animation reinforces hierarchy, relationships, structure, and cause and effect. <a href="https://smartech.gatech.edu/bitstream/handle/1853/3627/93-17.pdf">Research going back to the early ’90s</a><sup class="po" id="note-9"><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#9">9</a></sup> demonstrates that animation helps humans understand what’s happening on screen. Animation stitches together app states and offloads that work to the brain’s GPU — the visual cortex.</p>
  <p>For <strong>interaction developers</strong>, complex visuals — from infographics on dashboards to video games on tablets — are impossible to create without animation to glue all the pieces together. If we want those things on the Internet, we still need animation.</p>
  <p>Sadly, we have fallen behind in the motion design race. Products that use animation to benefit their users will succeed where their static or animation-abusing competitors will fail. As it stands, native apps are beating the pants off the web. App developers have been incorporating animation into their designs and fleshing out workflow and prototyping tools like <a href="https://www.flinto.com/">Flinto</a><sup class="po" id="note-10"><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#10">10</a></sup> and <a href="http://www.mitya-app.com/">Mitya</a><sup class="po" id="note-11"><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#11">11</a></sup> from day one.</p>
  <p>But things might be turning around. iOS’ Safari team pushed out the CSS animation and transition specifications so that websites can look and feel as good as iOS apps do. Even Google has picked up on this, <a href="http://www.google.com/design/spec/animation/authentic-motion.html">putting animation front and center</a><sup class="po" id="note-12"><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#12">12</a></sup> in its Material Design recommendations, with careful do’s and don’ts to apply animations and transitions meaningfully, with purpose.</p>
  <p>Animation is the natural next step in the evolution of our application and device ecosystem. It makes the digital world more intuitive and interesting for users of all ages. And so long as our devices sport GPUs, it’s not going away.</p>

  <h3 id="animating-all-the-things">Animating All The Things <a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#animating-all-the-things" class="sr hsl">Link</a></h3>
  <p>At its core, animation is just a visual representation of a rate of change over time and space. All animation can be distilled into three types:</p>
  <p><strong>Static animation</strong> runs from a start point to an end point, with no branching or logic. This can be <a href="http://codepen.io/rachelnabors/full/rCost">accomplished with CSS alone</a><sup class="po" id="note-13"><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#13">13</a></sup>, as the <a href="http://codepen.io/collection/HtAne/">abundance of CSS loading animations</a><sup class="po" id="note-14"><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#14">14</a></sup> testifies.</p>
  <img src="https://www.smashingmagazine.com/wp-content/uploads/2014/11/01-static-animation-opt.png" alt="Static animation" width="500" height="125" /><p><strong>Stateful animation</strong> in its simplest form takes boolean input — <a href="http://tympanus.net/Development/SimpleDropDownEffects/">a click to open a menu and a click to close it</a><sup class="po" id="note-15"><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#15">15</a></sup>, for instance — and animates between the two states. This is currently achieved in JavaScript frameworks by applying and removing classes with scoped CSS animation.</p>
  <img src="https://www.smashingmagazine.com/wp-content/uploads/2014/11/02-stateful-animation-opt.png" alt="Stateful animation" width="500" height="125" /><p><strong>Dynamic animation</strong> can have many outcomes depending on user input and other variables. It uses its own logic to determine how things should animate and what their endpoints are. It could entail “dragging” a page along behind your finger according to the speed of your swipe, or dynamically changing a graph as new data comes in. This is the trickiest kind of animation to accomplish with the tools at our disposal today. CSS alone cannot be used for this kind of animation.</p>
  <img src="https://www.smashingmagazine.com/wp-content/uploads/2014/11/03-dynamic-animation-opt.png" alt="Dynamic animation" width="500" height="358" /><h4 id="more-states-dynamic-animation">More States != Dynamic Animation <a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#more-states-dynamic-animation" class="sr hsl">Link</a></h4>
  <p>The astute CSS developer might point out that, with enough states, CSS animation could closely resemble dynamic animation. This is true to a point. But truly dynamic animation has more end states than you can possibly anticipate.</p>
  <img src="https://www.smashingmagazine.com/wp-content/uploads/2014/11/04-multi-state-vs-reactive-opt.png" alt="More States != Dynamic Animation" width="500" height="236" /><p>Just imagine the humble loading bar. Having a different class for every percentage point of “fullness” would easily run to a hundred lines of CSS, not to mention the number of times your JavaScript would have to touch the DOM to update the classes and the browser repaints. We definitely could write a more performant dynamic loader with JavaScript alone.</p>
  <p>CSS animation is declarative: Aside from a handful of pseudo-classes, such as <code>:hover</code> and <code>:target</code>, it accepts context from neither the user nor the user’s surroundings. It does only what its author tells it to do and cannot respond to new inputs or a changing environment. There’s no way to create a CSS animation that says “If you’re in the middle of the page, do this; otherwise, do that.” CSS doesn’t contain that sort of logic.</p>
  <p>When CSS-first developers need logic, they often start by scoping CSS to state classes, with JavaScript handling the logic of when to apply which class. Frameworks such as <a href="https://docs.angularjs.org/api/ngAnimate">AngularJS</a><sup class="po" id="note-16"><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#16">16</a></sup> support states, and many UI interactions adapt easily to a handful of states like “loading,” “open” and “selected.” These animations also degrade gracefully in old browsers, providing a much needed UX boost where CSS animation and transitions are supported.</p>
  <img src="https://www.smashingmagazine.com/wp-content/uploads/2014/11/05-ui-vs-ixd-opt.png" alt="05-ui-vs-ixd-opt" width="500" height="320" /><p>Interaction developers have had a different time of it. CSS animation is often too declarative to handle the things these developers want to build. Paying clients demand reliable animation across a wide spread of browsers; so, many interaction developers and their studios have done what all clever developers do: make labor-saving libraries customized to their own processes. Some of these libraries, like <a href="http://greensock.com/">GSAP</a><sup class="po" id="note-17"><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#17">17</a></sup> and <a href="http://julian.com/research/velocity/">Velocity</a><sup class="po" id="note-41"><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#41">41</a></sup><sup class="po" id="note-18"><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#18">18</a></sup>, are available to and developed for the public. But many others will never be released in the wild, because the people and agencies who created them don’t have the time or money (or will) to support an open-source project.</p>
  <p><img src="https://www.smashingmagazine.com/wp-content/uploads/2014/11/06-client-work-opt.png" alt="06-client-work-opt" width="500" height="314" /></p>
  <p>This is a deeply worrying story that I’ve heard over and over again, and it suggests that many developers are reinventing the wheel without moving the web forward. There isn’t enough demand for something considered “nice to have” to support many competitors. It’s easy to see how libraries like GSAP must be commercial in order to survive, or how sponsorships buoy libraries like Velocity.</p>
  <img src="https://www.smashingmagazine.com/wp-content/uploads/2014/11/07-flash-rule-opt.png" alt="07-flash-rule-opt" width="500" height="400" /><br />And Flash was a benevolent dictator, for its people did have a visual timeline UI.<p>Flash did a great thing by giving interaction developers and UI designers a universal workflow that accommodates all kinds of animations and a platform on which to edit them. But since <a href="https://www.apple.com/hotnews/thoughts-on-flash/">Steve Jobs announced back in 2010 that the iPhone would never support Flash</a><sup class="po" id="note-19"><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#19">19</a></sup>, many former Flash developers have quietly gone into exile, taking their niche knowledge with them. Now, an entire generation of web designers has come online with relatively no knowledge of the possibilities and challenges we face when ramping up animation complexity.</p>
  <p>But things are about to get quite… animated.</p>
  <h3 id="the-web-animation-api-the-greatest-an-api-youve-never-heard-of">The Web Animation API: <span style="text-decoration: line-through;">The Greatest</span> <em>An</em> API You’ve Never Heard Of <a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#the-web-animation-api-the-greatest-an-api-youve-never-heard-of" class="sr hsl">Link</a></h3>
  <p>The Web Animation API is a W3C specification that provides a unified language for CSS and SVG animations and that opens up the browser’s animation engine for developer manipulation. It does the following:</p>
  <ul><li>provide an API for the animation engine, enabling us to develop more in-browser animation tools and letting animation libraries tap into performance boosts;</li>
  <li>give (qualifying) animation their own thread, getting rid of jank;</li>
  <li>support <a href="http://dirkschulze.github.io/specs/motion-1/">motion paths</a><sup class="po" id="note-20"><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#20">20</a></sup>;</li>
  <li>provide post-animation callbacks;</li>
  <li>reintroduce <a href="https://github.com/web-animations/web-animations-js#sequencing-and-synchronizing-animations">nested and sequenced animations</a><sup class="po" id="note-21"><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#21">21</a></sup> that we haven’t seen since Flash;</li>
  <li>enable us to pause, play, seek, reverse, slow down or speed up playback with <a href="https://github.com/web-animations/web-animations-js#controlling-the-animation-timing">timing dictionaries</a><sup class="po" id="note-22"><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#22">22</a></sup> and <a href="https://github.com/web-animations/web-animations-js#playing-animations">animation player objects</a><sup class="po" id="note-23"><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#23">23</a></sup>.</li>
  </ul><p>Here’s <a href="http://codepen.io/rachelnabors/pen/zxYexJ/">just one example of what the Web Animation API can do that CSS alone cannot</a><sup class="po" id="note-24"><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#24">24</a></sup>.</p>
  <p class="codepen">See the Pen <a href="http://codepen.io/rachelnabors/pen/zxYexJ/">Running on Web Animations API</a><sup class="po" id="note-25"><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#25">25</a></sup> by Rachel Nabors (<a href="http://codepen.io/rachelnabors">@rachelnabors</a><sup class="po" id="note-26"><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#26">26</a></sup>) on <a href="http://codepen.io">CodePen</a><sup class="po" id="note-27"><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#27">27</a></sup>.</p>
  <h4 id="support">Support <a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#support" class="sr hsl">Link</a></h4>
  <p>The Web Animation API has been over two years in the making, and its features have been rolling out in Chrome and Firefox nightlies for the past six months. Mozilla is the major force behind the specification. Meanwhile, the Chrome team has been prioritizing the shipment of features.</p>
  <p><a href="https://status.modern.ie/webanimationsjavascriptapi?term=animations">Microsoft has the API “under consideration”</a><sup class="po" id="note-28"><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#28">28</a></sup> for Internet Explorer. Apple, surprisingly, has also adopted a wait-and-see approach for Safari. And we can only fantasize about when the API will hit those <a href="https://developer.amazon.com/appsandservices/solutions/platforms/webapps">web app engines powered by ancient forks of open-source browsers</a><sup class="po" id="note-29"><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#29">29</a></sup>.</p>
  <p>Early adopters who want to explore the API can try out a <a href="https://github.com/web-animations/web-animations-js">polyfill for the Web Animations API</a><sup class="po" id="note-30"><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#30">30</a></sup>, which is being replaced by <a href="https://github.com/web-animations/web-animations-next">Web Animations Next</a><sup class="po" id="note-31"><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#31">31</a></sup> literally any day now (more about the polyfill and the API can be found on the <a href="https://www.polymer-project.org/">website for the Polymer project</a><sup class="po" id="note-32"><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#32">32</a></sup>). However, for browsers that don’t support the API, the polyfill is still less performant than GSAP, the reigning champion of JavaScript-based animation libraries. Thus, the polyfill isn’t something interactive that developers will want to put into production for high-performance projects.</p>
  <p>It will be some time before this API is supported across the board. With half of browser makers waiting to see how developers will use it and most developers refusing to use a tool that isn’t widely supported, the API faces a chicken-and-egg scenario. However, in an on-stage conversation with Google’s Paul Kinlan at Fronteers, I suggested that, were the API to be fully supported in a closed and monetizable system for web apps, such as Google Play, developers would be able to safely use it in a walled garden until it reaches maturity and fuller support.</p>
  <h4 id="performance">Performance <a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#performance" class="sr hsl">Link</a></h4>
  <p>The API’s authors and implementers hope that animation library developers will start feature-sniffing for the API’s support to tap into its performance benefits. Because the Web Animation API uses the CSS rendering engine, we can expect CSS levels of performance. Animations will run on their own thread as long as they don’t depend on anything happening in the main thread, such as JavaScript or layout.</p>
  <p>Speaking of layout, reflowing remains one of the biggest processing hurdles for browsers. No CSS or JavaScript animation can get around it unless you’re pumping everything through WebGL straight to the GPU (which some clever in-house library developers have been doing). Aside from <code>opacity</code> and <code>transform</code>, animating the bulk of CSS properties will cause a reflow, a change in layout and/or a repaint of the pixels on the screen. The <a href="https://dev.opera.com/articles/css-will-change-property/"><code>will-change</code> CSS property helps some</a><sup class="po" id="note-33"><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#33">33</a></sup> by enabling us to point at something and tell the browser, “That, that thing is going to change. You do what you have to do change it efficiently.” The hope is that as browsers get smarter about graphics, they’ll move those elements into their own layer or otherwise optimize the way they handle those graphics. It’s the first step in eliminating hacks like <code>translateZ(0)</code>.</p>
  <p>Such “performance hacks” often get slapped on as a magic fix whenever an animation is janking, but they often cause performance issues when used unwittingly. Performance decisions are truly best left to the browser in the long run. Fortunately, browser makers are scrambling to get fewer properties to trigger reflows, thus keeping them off the main thread. For animation library developers, this means that the Web Animation API could be a winning partner for performance in the near future.</p>
  <h4 id="tools">Tools <a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#tools" class="sr hsl">Link</a></h4>
  <p>Anyone working with web animation yearns for proper animation development tools: a timeline, property inspection, better editors, and the ability to pause, rewind and otherwise inspect an animation while debugging. The Web Animation API will open the guts of the CSS rendering engine to developers and the browser vendors themselves to create these tools. Both <a href="http://src.chromium.org/viewvc/blink?view=revision&amp;revision=183847">Chrome</a><sup class="po" id="note-34"><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#34">34</a></sup> and Firefox are preparing animation features for their development tools. This API opens up those possibilities.</p>
  <p>Not many people other than those working on it are aware of the Web Animation API. The standards community is eager for real-world feedback from interaction and animation library developers. However, many developers feel that the standardistas live in an ivory tower, far removed from the rigors of the trenches, the demands of clients and the lessons learned from Flash.</p>
  <img src="https://www.smashingmagazine.com/wp-content/uploads/2014/11/08-flash-exile-opt.png" alt="08-flash-exile-opt" width="500" height="368" /><br />The old king’s champion sent into exile by the very people he once served.<br /><p>To be fair, the standardistas haven’t exactly come out to meet their audience in the field. To join the “official” Web Animation API conversation, you must jump through some hoops, and getting on the email chain threatens to overflow the inbox of any busy developer. Alternatively, you could get on IRC and join the conversation there — if only designers used IRC. The conversation that needs to happen is unlikely to happen if the people who have the most to say simply aren’t there. Vendors and specification authors will need to find more ways to reach out to their key audience or else risk building an API without an audience.</p>
  <p>But the standardistas aren’t the only ones with communication problems here. As a community, we are very judgmental and quick to deride things that we deem unworthy, be it Flash or an API we don’t like the look of. Many of us invest our egos in our tools and processes. But those things don’t define us. What we create together defines us.</p>
  <ul><li><strong>Animation library developers</strong>, <a href="http://w3c.github.io/web-animations/">read the specification</a><sup class="po" id="note-35"><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#35">35</a></sup>. It is long, but if GreenSock’s Jack Doyle can do it, so can you.</li>
  <li><strong>Interaction developers</strong> who don’t have all day to read a huge specification, just read the <a href="https://github.com/web-animations/web-animations-js#readme">readme on the polyfill’s page</a><sup class="po" id="note-36"><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#36">36</a></sup>. It’s a perfect TLDR. Now that you know what’s coming, you will know when it might be useful to you, whether for optimizing your library’s performance or building an in-browser timeline UI.</li>
  <li><strong>Designers</strong>, prioritize JavaScript at work. Play with the polyfill, and play with GSAP and Velocity. Find out what these things can do for your work that CSS alone cannot accomplish.</li>
  </ul><p>With web animation, we have a rare chance to put our egos aside and come together as a community to build a tool with which future generations of designers and developers can build great things. For their sake, I hope we can.</p>
  <blockquote>
  <p>“The art challenges the technology, and the technology inspires the art.”</p>
  <p>– John Lasseter, CCO Pixar</p>
  </blockquote>
  <h3 id="resources">Resources <a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#resources" class="sr hsl">Link</a></h3>
  <p>Rachel Nabors has an updated list of resources on the Web Animation API. To join the unofficial conversation, look for the <code>#waapi</code> hash tag wherever you prefer to communicate.</p>
  <ul><li><a href="http://w3c.github.io/web-animations/">Web Animations</a><sup class="po" id="note-37"><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#37">37</a></sup> (API specification), W3C</li>
  <li><a href="https://github.com/web-animations/web-animations-js">Web Animations polyfill</a><sup class="po" id="note-38"><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#38">38</a></sup> and <a href="https://github.com/web-animations/web-animations-next">Web Animation Next</a><sup class="po" id="note-39"><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#39">39</a></sup> (the next incarnation of the polyfill)</li>
  <li><a href="http://greensock.com/">GreenSock</a><sup class="po" id="note-40"><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#40">40</a></sup> animation library</li>
  <li><a href="http://julian.com/research/velocity/">Velocity</a><sup class="po"><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#41">41</a></sup><sup class="po"><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#18">18</a></sup>, a performant <code>.animate()</code> replacement for jQuery</li>
  </ul><h4 id="join-the-conversation">Join the Conversation <a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#join-the-conversation" class="sr hsl">Link</a></h4>
  <ul><li>Official mailing list: email <a href="mailto:public-fx@w3.org">public-fx@w3.org</a><sup class="po" id="note-42"><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#42">42</a></sup>, starting the subject line with <code>[web-animations] …</code></li>
  <li>IRC: <a href="http://irc.w3.org#webanimations">irc.w3.org#webanimations</a><sup class="po" id="note-43"><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#43">43</a></sup></li>
  <li>Everywhere else: use the hash tag <code>#waapi</code> and engage with the community</li>
  </ul><h4 id="make-a-difference">Make a Difference <a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#make-a-difference" class="sr hsl">Link</a></h4>
  <p>People who have some familiarity with C++ coding can help <a href="https://developer.mozilla.org/en-US/docs/Introduction">implement the API in Firefox</a><sup class="po" id="note-44"><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#44">44</a></sup>. <a href="https://twitter.com/brianskold">Brian Birtles</a><sup class="po" id="note-45"><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#45">45</a></sup> might even mentor you! And Mozilla is always looking for people to help write documentation on <a href="https://developer.mozilla.org/en-US/">MDN</a><sup class="po" id="note-46"><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#46">46</a></sup>.</p>
  <p>Minor corrections to the specification (grammar, spelling, inconsistencies, etc.) can be submitted as <a href="https://github.com/w3c/web-animations">pull requests on GitHub</a><sup class="po" id="note-47"><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#47">47</a></sup>.</p>
  <ul><li><a href="http://twitter.com/brianskold">Brian Birtles</a><sup class="po" id="note-48"><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#48">48</a></sup>, a principal author of the specification and with Mozilla Japan</li>
  <li><a href="http://twitter.com/alexanderdanilo">Alex Danilo</a><sup class="po" id="note-49"><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#49">49</a></sup>, Google platform team member and coauthor</li>
  <li><a href="http://twitter.com/tabatkins">Tab Atkins—Googler</a><sup class="po" id="note-50"><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#50">50</a></sup>, coauthor and contributor to the CSS specification</li>
  <li><a href="http://twitter.com/greensock">Jack Doyle</a><sup class="po" id="note-51"><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#51">51</a></sup>, member of GreenSock and GSAP</li>
  <li><a href="http://twitter.com/rachelnabors">Rachel Nabors</a><sup class="po" id="note-52"><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#52">52</a></sup>, head of animation think tank <a href="http://tinmagpie.com/">Tin Magpie</a><sup class="po" id="note-53"><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#53">53</a></sup></li>
  </ul><p><em>(al, ml)</em></p>
  <ol class="po"><li><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#note-1">1 https://www.smashingmagazine.com/2015/12/animating-clipped-elements-svg/</a></li><li><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#note-2">2 https://www.smashingmagazine.com/2015/09/creating-cel-animations-with-svg/</a></li><li><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#note-3">3 https://www.smashingmagazine.com/2015/06/practical-techniques-on-designing-animation/</a></li><li><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#note-4">4 https://www.smashingmagazine.com/2011/10/quick-look-math-animations-javascript/</a></li><li><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#note-5">5 https://www.smashingmagazine.com/2015/05/functional-ux-design-animations/</a></li><li><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#note-6">6 https://www.smashingmagazine.com/2015/06/creating-advanced-animations-in-photoshop/</a></li><li><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#note-7">7 https://www.smashingmagazine.com/2015/08/animating-in-keynote/</a></li><li><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#note-8">8 http://www.slideshare.net/CrowChick/animation-and-the-future-of-ux-33573726</a></li><li><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#note-9">9 https://smartech.gatech.edu/bitstream/handle/1853/3627/93-17.pdf</a></li><li><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#note-10">10 https://www.flinto.com/</a></li><li><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#note-11">11 http://www.mitya-app.com/</a></li><li><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#note-12">12 http://www.google.com/design/spec/animation/authentic-motion.html</a></li><li><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#note-13">13 http://codepen.io/rachelnabors/full/rCost</a></li><li><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#note-14">14 http://codepen.io/collection/HtAne/</a></li><li><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#note-15">15 http://tympanus.net/Development/SimpleDropDownEffects/</a></li><li><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#note-16">16 https://docs.angularjs.org/api/ngAnimate</a></li><li><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#note-17">17 http://greensock.com/</a></li><li><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#note-18">18 http://julian.com/research/velocity/</a></li><li><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#note-19">19 https://www.apple.com/hotnews/thoughts-on-flash/</a></li><li><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#note-20">20 http://dirkschulze.github.io/specs/motion-1/</a></li><li><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#note-21">21 https://github.com/web-animations/web-animations-js#sequencing-and-synchronizing-animations</a></li><li><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#note-22">22 https://github.com/web-animations/web-animations-js#controlling-the-animation-timing</a></li><li><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#note-23">23 https://github.com/web-animations/web-animations-js#playing-animations</a></li><li><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#note-24">24 http://codepen.io/rachelnabors/pen/zxYexJ/</a></li><li><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#note-25">25 'http://codepen.io/rachelnabors/pen/zxYexJ/'</a></li><li><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#note-26">26 'http://codepen.io/rachelnabors'</a></li><li><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#note-27">27 'http://codepen.io'</a></li><li><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#note-28">28 https://status.modern.ie/webanimationsjavascriptapi?term=animations</a></li><li><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#note-29">29 https://developer.amazon.com/appsandservices/solutions/platforms/webapps</a></li><li><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#note-30">30 https://github.com/web-animations/web-animations-js</a></li><li><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#note-31">31 https://github.com/web-animations/web-animations-next</a></li><li><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#note-32">32 https://www.polymer-project.org/</a></li><li><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#note-33">33 https://dev.opera.com/articles/css-will-change-property/</a></li><li><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#note-34">34 http://src.chromium.org/viewvc/blink?view=revision&amp;revision=183847</a></li><li><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#note-35">35 http://w3c.github.io/web-animations/</a></li><li><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#note-36">36 https://github.com/web-animations/web-animations-js#readme</a></li><li><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#note-37">37 http://w3c.github.io/web-animations/</a></li><li><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#note-38">38 https://github.com/web-animations/web-animations-js</a></li><li><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#note-39">39 https://github.com/web-animations/web-animations-next</a></li><li><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#note-40">40 http://greensock.com/</a></li><li><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#note-41">41 http://julian.com/research/velocity/</a></li><li><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#note-42">42 mailto:public-fx@w3.org</a></li><li><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#note-43">43 http://irc.w3.org#webanimations</a></li><li><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#note-44">44 https://developer.mozilla.org/en-US/docs/Introduction</a></li><li><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#note-45">45 https://twitter.com/brianskold</a></li><li><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#note-46">46 https://developer.mozilla.org/en-US/</a></li><li><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#note-47">47 https://github.com/w3c/web-animations</a></li><li><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#note-48">48 http://twitter.com/brianskold</a></li><li><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#note-49">49 http://twitter.com/alexanderdanilo</a></li><li><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#note-50">50 http://twitter.com/tabatkins</a></li><li><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#note-51">51 http://twitter.com/greensock</a></li><li><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#note-52">52 http://twitter.com/rachelnabors</a></li><li><a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#note-53">53 http://tinmagpie.com/</a></li></ol><p><a href="https://www.smashingmagazine.com/tag/animation/">Animation</a><a href="https://www.smashingmagazine.com/tag/api/">API</a><a href="https://www.smashingmagazine.com/tag/css/">CSS</a></p>
  <p>
  	<a href="https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/#top" class="top">↑ Back to top</a>
  	<a class="sot single" href="https://twitter.com/intent/tweet?original_referer=https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/&amp;source=tweetbutton&amp;text=The%20State%20Of%20Animation%202014&amp;url=https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/&amp;via=smashingmag">Tweet it</a><a class="sot single" href="http://www.facebook.com/sharer/sharer.php?u=https://www.smashingmagazine.com/2014/11/the-state-of-animation-2014/">Share on Facebook</a></p>


title: Tous les saucissons secs artisanaux de nos régions de France.
url: http://laroutedusaucisson.fr/144-tous-nos-saucissons
created_at: 2017-08-10 23:18:34
updated_at: 2017-08-10 23:18:34
mimetype: text/html
language: fr
domain_name: laroutedusaucisson.fr
http_status: 200
content:
  <p> <a class="home" href="http://laroutedusaucisson.fr/" title="retour à Accueil"><i class="icon-home"></i></a> &gt; Charcuterie</p><div class="row"><div id="center_column" class="center_column col-xs-12 col-sm-9"><div class="content_sortPagiBar clearfix"><div class="sortPagiBar clearfix"><form id="productsSortForm" action="http://laroutedusaucisson.fr/144-tous-nos-saucissons" class="productsSortForm"><p> <label for="selectProductSort">Tri</label> </p></form></div></div><ul class="product_list grid row"><li class="ajax_block_product col-xs-12 col-sm-6 col-md-4 first-in-line first-item-of-tablet-line first-item-of-mobile-line"><div class="product-container"><div class="left-block"><div class="product-image-container"> <a class="product_img_link" href="http://laroutedusaucisson.fr/pays-basque/11-saucisson-sec-ibaiama-du-pays-basque.html" title="Saucisson Sec du Pays Basque"> <img class="replace-2x img-responsive" src="http://laroutedusaucisson.fr/30-home_default/saucisson-sec-ibaiama-du-pays-basque.jpg" alt="Saucisson Sec du Pays Basque" title="Saucisson Sec du Pays Basque" width="250" height="250" /></a><p>  6,50 € </p></div></div><div class="right-block"><h5> <a class="product-name" href="http://laroutedusaucisson.fr/pays-basque/11-saucisson-sec-ibaiama-du-pays-basque.html" title="Saucisson Sec du Pays Basque"> Saucisson Sec du Pays Basque </a></h5><p class="product-desc"> Saucisson Sec Ibaiama à base de Porc Basque. Il sèche sous les influences maritimes de l'océan et montagneuses des Pyrénées: un délice ! Conserver ce produit dans un endroit frais et sec, entre 12 et 18°C (cave). Vous pouvez le stocker dans son papier d'emballage au réfrigérateur. Déguster ce produit à température ambiante, il révèlera toutes ses saveurs.</p><p>  6,50 € </p><p> <a class="button ajax_add_to_cart_button btn btn-default" href="http://laroutedusaucisson.fr/panier?add=1&amp;id_product=11&amp;token=f46409d6f767dce76476e8e5c1414891" rel="nofollow" title="Ajouter au panier"> Ajouter au panier </a> <a class="button lnk_view btn btn-default" href="http://laroutedusaucisson.fr/pays-basque/11-saucisson-sec-ibaiama-du-pays-basque.html" title="Afficher"> Détails </a></p>  En stock  </div></div></li><li class="ajax_block_product col-xs-12 col-sm-6 col-md-4 last-item-of-tablet-line"><div class="product-container"><div class="left-block"><div class="product-image-container"> <a class="product_img_link" href="http://laroutedusaucisson.fr/sud-ouest/13-beret-basque-artisanal.html" title="Béret Basque Artisanal"> <img class="replace-2x img-responsive" src="http://laroutedusaucisson.fr/36-home_default/beret-basque-artisanal.jpg" alt="Béret Basque Artisanal" title="Béret Basque Artisanal" width="250" height="250" /></a><p>  7,50 € </p></div></div><div class="right-block"><h5> <a class="product-name" href="http://laroutedusaucisson.fr/sud-ouest/13-beret-basque-artisanal.html" title="Béret Basque Artisanal"> Béret Basque Artisanal </a></h5><p class="product-desc"> Le Béret Basque est la star du Pays Basque. Ce saucisson sans peau délicatement poivré vous transportera au Pays Basque en une bouchée ! Conserver ce produit dans un endroit frais et sec, entre 12 et 18°C (cave). Vous pouvez le stocker dans son papier d'emballage au réfrigérateur. Déguster ce produit à température ambiante, il révèlera toutes ses saveurs.</p><p>  7,50 € </p><p> <a class="button ajax_add_to_cart_button btn btn-default" href="http://laroutedusaucisson.fr/panier?add=1&amp;id_product=13&amp;token=f46409d6f767dce76476e8e5c1414891" rel="nofollow" title="Ajouter au panier"> Ajouter au panier </a> <a class="button lnk_view btn btn-default" href="http://laroutedusaucisson.fr/sud-ouest/13-beret-basque-artisanal.html" title="Afficher"> Détails </a></p>  En stock  </div></div></li><li class="ajax_block_product col-xs-12 col-sm-6 col-md-4 last-in-line first-item-of-tablet-line last-item-of-mobile-line"><div class="product-container"><div class="left-block"><div class="product-image-container"> <a class="product_img_link" href="http://laroutedusaucisson.fr/sud-ouest/14-boneta-au-piment-d-espelette-du-pays-basque.html" title="Boneta au Piment d'Espelette du Pays Basque"> <img class="replace-2x img-responsive" src="http://laroutedusaucisson.fr/40-home_default/boneta-au-piment-d-espelette-du-pays-basque.jpg" alt="Boneta au Piment d'Espelette du Pays Basque" title="Boneta au Piment d'Espelette du Pays Basque" width="250" height="250" /></a><p>  7,50 € </p></div></div><div class="right-block"><h5> <a class="product-name" href="http://laroutedusaucisson.fr/sud-ouest/14-boneta-au-piment-d-espelette-du-pays-basque.html" title="Boneta au Piment d'Espelette du Pays Basque"> Boneta au Piment d'Espelette du Pays Basque </a></h5><p class="product-desc"> Le Boneta est le petit frère du Béret Basque. Ce saucisson sans peau délicatement relevé par le piment d'Espelette vous transportera au Pays Basque ! Conserver ce produit dans un endroit frais et sec, entre 12 et 18°C (cave). Vous pouvez le stocker dans son papier d'emballage au réfrigérateur. Déguster ce produit à température ambiante, il révèlera toutes...</p><p>  7,50 € </p><p> <a class="button ajax_add_to_cart_button btn btn-default" href="http://laroutedusaucisson.fr/panier?add=1&amp;id_product=14&amp;token=f46409d6f767dce76476e8e5c1414891" rel="nofollow" title="Ajouter au panier"> Ajouter au panier </a> <a class="button lnk_view btn btn-default" href="http://laroutedusaucisson.fr/sud-ouest/14-boneta-au-piment-d-espelette-du-pays-basque.html" title="Afficher"> Détails </a></p>  En stock  </div></div></li><li class="ajax_block_product col-xs-12 col-sm-6 col-md-4 first-in-line last-item-of-tablet-line first-item-of-mobile-line"><div class="product-container"><div class="left-block"><div class="product-image-container"> <a class="product_img_link" href="http://laroutedusaucisson.fr/sud-ouest/12-saucisse-seche-basque-au-piment-d-espelette.html" title="Saucisse Sèche Basque au Piment d'Espelette"> <img class="replace-2x img-responsive" src="http://laroutedusaucisson.fr/33-home_default/saucisse-seche-basque-au-piment-d-espelette.jpg" alt="Saucisse Sèche Basque au Piment d'Espelette" title="Saucisse Sèche Basque au Piment d'Espelette" width="250" height="250" /></a><p>  5,90 € </p></div></div><div class="right-block"><h5> <a class="product-name" href="http://laroutedusaucisson.fr/sud-ouest/12-saucisse-seche-basque-au-piment-d-espelette.html" title="Saucisse Sèche Basque au Piment d'Espelette"> Saucisse Sèche Basque au Piment d'Espelette </a></h5><p class="product-desc"> Saucisse Sèche artisanale à base de Porc Basque agrémentée d'une épice typique du Pays Basque, le piment d'Espelette. Son goût est relevé mais non piquant. Conserver ce produit dans un endroit frais et sec, entre 12 et 18°C (cave). Vous pouvez le stocker dans son papier d'emballage au réfrigérateur. Déguster ce produit à température ambiante, il révèlera...</p><p>  5,90 € </p><p> <a class="button ajax_add_to_cart_button btn btn-default" href="http://laroutedusaucisson.fr/panier?add=1&amp;id_product=12&amp;token=f46409d6f767dce76476e8e5c1414891" rel="nofollow" title="Ajouter au panier"> Ajouter au panier </a> <a class="button lnk_view btn btn-default" href="http://laroutedusaucisson.fr/sud-ouest/12-saucisse-seche-basque-au-piment-d-espelette.html" title="Afficher"> Détails </a></p>  En stock  </div></div></li><li class="ajax_block_product col-xs-12 col-sm-6 col-md-4 first-item-of-tablet-line"><div class="product-container"><div class="left-block"><div class="product-image-container"> <a class="product_img_link" href="http://laroutedusaucisson.fr/sud-ouest/15-chorizo-artisanal-du-pays-basque.html" title="Chorizo Artisanal du Pays Basque"> <img class="replace-2x img-responsive" src="http://laroutedusaucisson.fr/44-home_default/chorizo-artisanal-du-pays-basque.jpg" alt="Chorizo Artisanal du Pays Basque" title="Chorizo Artisanal du Pays Basque" width="250" height="250" /></a><p>  6,00 € </p></div></div><div class="right-block"><h5> <a class="product-name" href="http://laroutedusaucisson.fr/sud-ouest/15-chorizo-artisanal-du-pays-basque.html" title="Chorizo Artisanal du Pays Basque"> Chorizo Artisanal du Pays Basque </a></h5><p class="product-desc"> Chorizo artisanal à base de Porc Basque et d'épices de grande qualité. Son goût est parfaitement relevé mais peu piquant. Conserver ce produit dans un endroit frais et sec, entre 12 et 18°C (cave). Vous pouvez le stocker dans son papier d'emballage au réfrigérateur. Déguster à température ambiante ou cuisiné, il révèlera toutes ses saveurs.</p><p>  6,00 € </p><p> <a class="button ajax_add_to_cart_button btn btn-default" href="http://laroutedusaucisson.fr/panier?add=1&amp;id_product=15&amp;token=f46409d6f767dce76476e8e5c1414891" rel="nofollow" title="Ajouter au panier"> Ajouter au panier </a> <a class="button lnk_view btn btn-default" href="http://laroutedusaucisson.fr/sud-ouest/15-chorizo-artisanal-du-pays-basque.html" title="Afficher"> Détails </a></p>  En stock  </div></div></li><li class="ajax_block_product col-xs-12 col-sm-6 col-md-4 last-in-line last-item-of-tablet-line last-item-of-mobile-line"><div class="product-container"><div class="left-block"><div class="product-image-container"> <a class="product_img_link" href="http://laroutedusaucisson.fr/sud-ouest/20-saucisson-sec-artisanal-de-l-aveyron.html" title="Saucisson Sec Artisanal de l'Aveyron"> <img class="replace-2x img-responsive" src="http://laroutedusaucisson.fr/51-home_default/saucisson-sec-artisanal-de-l-aveyron.jpg" alt="Saucisson Sec Artisanal de l'Aveyron" title="Saucisson Sec Artisanal de l'Aveyron" width="250" height="250" /></a><p>  7,00 € </p></div></div><div class="right-block"><h5> <a class="product-name" href="http://laroutedusaucisson.fr/sud-ouest/20-saucisson-sec-artisanal-de-l-aveyron.html" title="Saucisson Sec Artisanal de l'Aveyron"> Saucisson Sec Artisanal de l'Aveyron </a></h5><p class="product-desc"> Saucisson Sec artisanal de l'Aveyron. Une recette ancestrale pour une savoureuse dégustation. Conserver ce produit dans un endroit frais et sec, entre 12 et 18°C (cave). Vous pouvez le stocker dans son papier d'emballage au réfrigérateur. Déguster ce produit à température ambiante, il révèlera toutes ses saveurs.</p><p>  7,00 € </p><p>  Ajouter au panier  <a class="button lnk_view btn btn-default" href="http://laroutedusaucisson.fr/sud-ouest/20-saucisson-sec-artisanal-de-l-aveyron.html" title="Afficher"> Détails </a></p>  Rupture de stock  </div></div></li><li class="ajax_block_product col-xs-12 col-sm-6 col-md-4 first-in-line last-line first-item-of-tablet-line first-item-of-mobile-line last-mobile-line"><div class="product-container"><div class="left-block"><div class="product-image-container"> <a class="product_img_link" href="http://laroutedusaucisson.fr/sud-ouest/23-saucisse-seche-d-aveyron-aux-noix-du-perigord.html" title="Saucisse Sèche D'Aveyron aux Noix du Perigord"> <img class="replace-2x img-responsive" src="http://laroutedusaucisson.fr/60-home_default/saucisse-seche-d-aveyron-aux-noix-du-perigord.jpg" alt="Saucisse Sèche D'Aveyron aux Noix du Perigord" title="Saucisse Sèche D'Aveyron aux Noix du Perigord" width="250" height="250" /></a><p>  5,70 € </p></div></div><div class="right-block"><h5> <a class="product-name" href="http://laroutedusaucisson.fr/sud-ouest/23-saucisse-seche-d-aveyron-aux-noix-du-perigord.html" title="Saucisse Sèche D'Aveyron aux Noix du Perigord"> Saucisse Sèche D'Aveyron aux Noix du Perigord </a></h5><p class="product-desc"> Le plaisir d'une saucisse sèche de l'Aveyron finement agrémentée de noix du département voisin. Conserver ce produit dans un endroit frais et sec, entre 12 et 18°C (cave). Vous pouvez le stocker dans son papier d'emballage au réfrigérateur. Déguster ce produit à température ambiante, il révèlera toutes ses saveurs.</p><p>  5,70 € </p><p>  Ajouter au panier  <a class="button lnk_view btn btn-default" href="http://laroutedusaucisson.fr/sud-ouest/23-saucisse-seche-d-aveyron-aux-noix-du-perigord.html" title="Afficher"> Détails </a></p>  Rupture de stock  </div></div></li><li class="ajax_block_product col-xs-12 col-sm-6 col-md-4 last-line last-item-of-tablet-line last-mobile-line"><div class="product-container"><div class="left-block"><div class="product-image-container"> <a class="product_img_link" href="http://laroutedusaucisson.fr/sud-ouest/28-saucisson-bride-88-de-maigre-d-aveyron.html" title="Saucisson Bridé 88% de maigre d'Aveyron"> <img class="replace-2x img-responsive" src="http://laroutedusaucisson.fr/71-home_default/saucisson-bride-88-de-maigre-d-aveyron.jpg" alt="Saucisson Bridé 88% de maigre d'Aveyron" title="Saucisson Bridé 88% de maigre d'Aveyron" width="250" height="250" /></a><p>  14,50 € </p></div></div><div class="right-block"><h5> <a class="product-name" href="http://laroutedusaucisson.fr/sud-ouest/28-saucisson-bride-88-de-maigre-d-aveyron.html" title="Saucisson Bridé 88% de maigre d'Aveyron"> Saucisson Bridé 88% de maigre d'Aveyron </a></h5><p class="product-desc"> Saucisson Sec 88% de maigre de l'Aveyron: moins de gras et plus de maigre pour un plaisir plus léger. Conserver ce produit dans un endroit frais et sec, entre 12 et 18°C (cave). Vous pouvez le stocker dans son papier d'emballage au réfrigérateur. Déguster ce produit à température ambiante, il révèlera toutes ses saveurs.</p><p>  14,50 € </p><p>  Ajouter au panier  <a class="button lnk_view btn btn-default" href="http://laroutedusaucisson.fr/sud-ouest/28-saucisson-bride-88-de-maigre-d-aveyron.html" title="Afficher"> Détails </a></p>  Rupture de stock  </div></div></li><li class="ajax_block_product col-xs-12 col-sm-6 col-md-4 last-in-line last-line first-item-of-tablet-line last-item-of-mobile-line last-mobile-line"><div class="product-container"><div class="left-block"><div class="product-image-container"> <a class="product_img_link" href="http://laroutedusaucisson.fr/tous-nos-saucissons/82-saucisson-artisanal-corse.html" title="Saucisson artisanal Corse"> <img class="replace-2x img-responsive" src="http://laroutedusaucisson.fr/247-home_default/saucisson-artisanal-corse.jpg" alt="Saucisson artisanal Corse" title="Saucisson artisanal Corse" width="250" height="250" /></a><p>  9,50 € </p></div></div><div class="right-block"><h5> <a class="product-name" href="http://laroutedusaucisson.fr/tous-nos-saucissons/82-saucisson-artisanal-corse.html" title="Saucisson artisanal Corse"> Saucisson artisanal Corse </a></h5><p class="product-desc"> Véritable saucisson artisanal de Corse légèrement fumé au bois de châtaignier. séché entre 60 et 240 jours. composé de 80% de maigre de jambon et de 20% de gras de barrière. Conserver ce produit dans un endroit frais et sec, entre 12 et 18°C (cave). Vous pouvez le stocker dans son papier d'emballage au réfrigérateur. Déguster ce produit à température...</p><p>  9,50 € </p><p>  Ajouter au panier  <a class="button lnk_view btn btn-default" href="http://laroutedusaucisson.fr/tous-nos-saucissons/82-saucisson-artisanal-corse.html" title="Afficher"> Détails </a></p>  Rupture de stock  </div></div></li></ul><div class="content_sortPagiBar"><div class="bottom-pagination-content clearfix"><p> Résultats 1 - 9 sur 9.</p></div></div></div></div>


url: https://www.revue-ballast.fr/franck-lepage/
created_at: 2017-08-10 23:18:36
updated_at: 2017-08-10 23:18:36
mimetype: text/html
language: fr-FR
domain_name: www.revue-ballast.fr
preview_picture: https://www.revue-ballast.fr/wp-content/uploads/2015/06/flp2.jpg
http_status: 200
title:
  BALLAST | Franck Lepage : "L'école fabrique des travailleurs adaptables et non des esprits critiques"

content:
  <hr /><h6>Entretien inédit pour le site de <em>Ballast</em></h6>
  <p><em>Ancien directeur du développement culturel à la Fédération française des maisons des jeunes et de la culture, auteur des conférences gesticulées « Inculture(s) 1 — L’éducation populaire, Monsieur, ils n’en ont pas voulu (une autre histoire de la culture) » et « Inculture(s) 2 — Et si on empêchait les riches de s’instruire plus vite que les pauvres (une autre histoire de l’éducation) », cofondateur de la coopérative d’éducation populaire <a href="http://www.scoplepave.org/" target="_blank">Le Pavé</a> et de l’association l’Ardeur, militant se refusant artiste, décrit comme un « </em>Desproges bourdieusien¹<em> », Lepage affirme que « </em>la démocratie ne tombe pas du ciel, elle s’apprend et s’enseigne<em> » et que «</em> pour être durable, elle doit être choisie : il faut donc que chacun puisse y réfléchir <em>». Il défend qu’il « </em>incombe à la République d’ajouter un volet à l’instruction publique : une éducation politique des jeunes adultes²<em> ». Dans l’une de ses conférences, il explique à travers son propre parcours et ce qu’il appelle « </em>son échec d’ascension sociale <em>» comment le système éducatif français actuel favorise la reproduction des inégalités de classe et comment son regard sur l’éducation a été profondément influencé par ses études à feu l’Université expérimentale de Vincennes, dans les années 1970. Entretien, quelque part en Guadeloupe.</em></p>
  <hr /><p><img class="alignleft wp-image-4693 size-full" src="https://www.revue-ballast.fr/wp-content/uploads/2015/06/lepage1.jpg" alt="lepage1" width="300" height="300" /><strong>Dans votre conférence gesticulée « Inculture(s) 2 », vous parlez de l’Université expérimentale de Vincennes, qui a ouvert ses portes aux lendemains de Mai 68 pour apporter une réponse aux revendications des étudiants. Pouvez-vous décrire comment vous avez perçu cette expérience et ce qu’elle avait de révolutionnaire ?</strong></p>
  <p>C’était un puissant sentiment d’égalité. Comparativement aux autres facultés où j’ai étudié, je ne m’y sentais pas « élève » : je m’y sentais chez moi. C’était un sentiment curieux où l’on se sentait complètement maître de ce que l’on avait envie de faire et d’apprendre. Il n’y avait que des gens qui étaient là pour développer une pensée critique et non obtenir un diplôme ; il y avait une effervescence intellectuelle où tout le monde cogitait, une sorte de bouillonnement incroyable et, pour la première fois comme étudiant, j’ai eu l’impression d’être un adulte et que ce que je disais comptait. On n’arrêtait pas de proposer des choses, de modifier les cours : nous étions tous chercheurs. Il y avait un monde fou : 32 000 étudiants ! C’était une ville. Il y avait un souk dehors, des assemblées générales tout le temps, on recevait sans arrêt des révolutionnaires : des Palestiniens, des Irlandais… C’était un endroit où l’on formait de la pensée contre le capitalisme, dans les années 1970, puisque <a href="https://fr.wikipedia.org/wiki/Centre_universitaire_de_Vincennes" target="_blank">l’Université de Vincennes</a> a duré de 1969 à 1980. On pouvait circuler librement dans les salles et si on avait une après-midi à tuer, on pouvait aller assister à n’importe quel cours. On pouvait se gaver de savoir critique.</p>
  <blockquote>
  <p><strong>« Il n’y avait que des gens qui étaient là pour développer une pensée critique et non obtenir un diplôme ; il y avait une effervescence intellectuelle où tout le monde cogitait, une sorte de bouillonnement. »</strong></p>
  </blockquote>
  <p>Il y avait des départements et des filières dans à peu près toutes les disciplines des sciences humaines, mais aussi en mathématiques et en langues. On pouvait passer des diplômes mais ils étaient uniquement reconnus à Vincennes. Le contenu des cours était toujours négocié ; c’était un régime d’assemblée générale permanente. Il faut se rappeler que, dans les années 1970, tout était politique. Tout le monde était engagé et si tu ne l’étais pas, tu étais un bouffon ; aujourd’hui, c’est l’inverse : si tu es engagé, tu en es un. Il existait une forme d’égalité avec les professeurs, qui étaient sans cesse remis en question : dès qu’un truc n’allait pas, on séquestrait le président (qui était un allié). Il y avait des grèves tout le temps ; politiquement, ça n’arrêtait pas. Ça a d’ailleurs été énormément décrié par les médias, qui ne voyaient ça seulement sous l’angle du foutoir, du bordel et de la drogue. Il n’y avait que des adultes et j’y ai rencontré des gens passionnants. Curieusement, il y a eu très peu de travaux sur cette expérience de Vincennes, en tout cas, peu de travaux de fond. Il existe un film, <a href="http://www.dailymotion.com/video/x9p4i5_vincennes-le-ghetto-experimental-ex_news" target="_blank"><em>Le ghetto expérimental</em></a>, mais il donne une image bordélique et, pour moi qui l’ai vécu, il ne rend pas justice à ce qu’était Vincennes. Bien sûr, 32 000 étudiants en autogestion, ce n’était pas simple ! Il y avait des affiches révolutionnaires partout sur les murs et, pour aller d’un département à l’autre, il fallait traverser des terrains vagues — mais ce n’était pas cela qui était important… Les bâtiments avaient été réquisitionnés auprès de l’armée. Je n’y ai fait que des études intéressantes, je n’ai pas souvenir d’un seul cours dans lequel je me sois ennuyé. J’ai appris à faire du cinéma, des films d’animation, du théâtre forum… Tous les professeurs intéressants voulaient enseigner à Vincennes et ils savaient pourquoi ils étaient là.</p>
  <p><strong>Régis Debray a récemment déclaré sur France Inter : «<em> Il y a deux fondamentaux, l’effort de l’élève et l’autorité du maître. Ça paraît banal mais l’enseignement est un lieu d’exigence. […] Et l’autorité du maître est fondée sur le savoir, le maître sait des choses que l’élève ne sait pas et donc il y a une hiérarchie. Elle est fondée sur le travail et sur l’effort qui sont plutôt des valeurs de gauche me semble-t-il</em>³. » Que vous inspire cette vision de l’éducation ?</strong></p>
  <p>C’est complètement idiot. C’est la vision de l’éducation portée par <a href="http://www.marianne.net/regis-debray-france-est-rentree-troupeau-occident-100234457.html" target="_blank">Régis Debray</a>, <a href="https://fr.wikipedia.org/wiki/Alain_Finkielkraut" target="_blank">Alain Finkielkraut</a>, <a href="https://fr.wikipedia.org/wiki/%C3%89lisabeth_de_Fontenay" target="_blank">Élisabeth de Fontenay</a>, <a href="http://www.laicite-republique.org/+-charles-coutel-+.html" target="_blank">Charles Coutel</a> et toute leur clique — qui en appellent à l’école comme lieu de discipline. C’est toute la théorie du maître. On a complètement dépassé cela depuis : il suffit de lire <em>Le Maître ignorant</em> de <a href="https://fr.wikipedia.org/wiki/Jacques_Ranci%C3%A8re" target="_blank">Jacques Rancière</a> pour s’en rendre compte. Pour comprendre, il faut remettre Debray dans son époque. Les années 1970 sont d’une extrême effervescence en terme de réflexion pédagogique : du fait du plein emploi (du moins pour les hommes, comme le rappelle <a href="https://fr.wikipedia.org/wiki/Bernard_Friot_(sociologue)" target="_blank">Bernard Friot</a> — les femmes étant alors moins demandeuses d’emploi) et que tout allait bien, on a commencé à remettre en question ce qu’était l’école. Il y avait des expérimentations pédagogiques absolument partout : c’était l’époque des écoles parallèles et tout le monde se mettait à faire de la pédagogie à la <a href="https://fr.wikipedia.org/wiki/P%C3%A9dagogie_Freinet" target="_blank">Freinet</a>. Le système d’éducation descendant centré sur le maître, à la mode III<sup>e</sup> République, apparaissait comme non fonctionnel, comparativement. Mais tout ce courant novateur allait se refermer dans les années 1980, avec l’apparition du chômage. L’école allait très brutalement changer de cap pour devenir le lieu d’un fantasme des pouvoirs publics et des parents, selon lequel c’est à l’école de donner un emploi. En quelques années, toutes les expériences pédagogiques disparurent et l’on rentra à nouveau dans un schéma de l’école orientée vers les résultats et les diplômes — donc une école extrêmement sélective. Évidemment, cela n’a pas marché et a laissé quantité de gens des classes populaires sur le carreau. Le discours de Debray, qui était par conséquent réactionnaire, préconisa la restauration de l’autorité du maître. Pourtant, c’est souvent une bonne chose quand il y a désaveu du professeur. Nul besoin d’être très matérialiste ou sociologue pour se rendre compte que lorsque des élèves de banlieue envoient balader un professeur, ils ont souvent raison de le faire.</p>
  <div id="attachment_4695" class="wp-caption alignnone"><img class="wp-image-4695 size-full" src="https://www.revue-ballast.fr/wp-content/uploads/2015/06/debray.jpg" alt="debray" width="957" height="318" /><p class="wp-caption-text">Régis Debray (par Aldo Soares, pour <em>Marianne</em>)</p></div>
  <p>On sait par ailleurs que l’autorité commence précisément là où s’arrête le pouvoir. J’ai été instituteur dans une école Freinet, durant un an, et mon expérience m’a montré que lorsque l’on donne le pouvoir aux enfants, lorsqu’on leur dit qu’ils peuvent parler quand ils veulent et à qui ils veulent pendant la classe, on a le sentiment de mettre son propre pouvoir en danger — et c’est ça qui est intéressant ! On est alors obligé de revoir complètement son rapport à l’élève. Et tous les bons professeurs que nous avons eus ne se sont jamais servis de leur pouvoir. Ils étaient si sûrs d’eux, dans leur envie d’enseigner, qu’ils étaient prêts à engager un dialogue avec les élèves, sans être pour autant terrorisés à chaque fois qu’il y avait du chahut. Et ces professeurs là disposaient d’une grande autorité tout en n’ayant jamais besoin de se servir de leur pouvoir. On les respectait considérablement. Un bon maître, c’est quelqu’un qui s’est débarrassé du pouvoir. Donc la théorie du maître telle que la développe Finkielkraut et sa bande ne tient pas : elle est même grotesque. Elle ne sert que l’élite. Toutes les expériences que j’ai eues me l’ont montré. Il suffit de vous souvenir quelles sont les matières que vous avez aimé étudier : ce sont rarement celles où le professeur se comportait comme un dictateur.</p>
  <p><strong>Vous venez de citer Rancière. Dans un entretien paru dans la revue <em>Nouveaux Regards</em>, il déclara : « <em>Aucune institution n’est en elle-même émancipatrice. […] Donc il ne faut pas raisonner en termes d’institution. L’essentiel est d’aider les gens à basculer d’un état d’incapacité reconnue à un état d’égalité où on se considère capable de tout parce qu’on considère aussi les autres comme capables de tout<sup>4</sup>. </em>» Ê</strong><strong>tes-vous d’accord avec ceci ? Quelle place à vos yeux pour l’éducation populaire ?</strong></p>
  <blockquote>
  <p><strong>« Un bon maître, c’est quelqu’un qui s’est débarrassé du pouvoir. La théorie du maître telle que la développe Finkielkraut ne tient pas : elle ne sert que l’élite. Toutes les expériences que j’ai eues me l’ont montré. »</strong></p>
  </blockquote>
  <p>Il y a deux très grandes confusions lorsque l’on parle d’éducation populaire. Premièrement, l’éducation populaire, telle que reconnue officiellement et mise sous forme associative, ne fait pas d’éducation populaire ! Cela pose problème. Je suis bien placé pour le savoir, j’ai travaillé pendant douze ans dans une Fédération d’éducation populaire et mon travail a précisément consisté à démontrer que l’on ne faisait pas d’éducation populaire. Ils faisaient de l’animation socio-culturelle. Ce n’étaient sûrement pas des sujets qui fabriquaient du savoir politique. Mais pour convaincre une MJC (qui fonctionne par offres d’activités, avec 80 activités à 800 euros l’année) de faire du travail politique avec des jeunes, vous pouvez toujours essayer ! Allez expliquer à une dame qui a payé pour faire du yoga qu’elle doit se mobiliser contre le <a href="https://fr.wikipedia.org/wiki/Partenariat_transatlantique_de_commerce_et_d'investissement" target="_blank">TAFTA</a>, elle va vous rétorquer qu’elle a payé pour faire du yoga et vous demander de la laisser tranquille ! Le problème a été la professionnalisation de ce qu’a été l’éducation populaire dans les années 1960. Et la ringardisation progressive de l’animation socio-culturelle a mené les associations à ne plus faire du tout d’éducation populaire : il n’y a plus d’éducation populaire dans les Fédérations d’éducation populaire.</p>
  <p>La deuxième ambiguïté, c’est que le terme « éducation populaire » est mal choisi : les gens entendent « éducation du peuple ». Alors que l’éducation du peuple, c’est l’éducation nationale qui s’en charge en tentant de faire descendre du savoir dans ce qu’ils pensent être des vases vides — dans l’esprit  « <em>le peuple est bête, nous allons l’éduquer</em> ». En fait, « populaire » est un adjectif qui renvoie à la forme utilisée, qui est populaire : c’est donc précisément tout sauf une forme descendante d’éducation. Les Anglais utilisent un terme approchant, « <em>peer education</em> » (éducation mutuelle). Ce que nous (les gens qui gravitons dans cette tentative de renouer avec l’éducation populaire telle qu’on pense qu’elle n’aurait jamais dû cesser d’être) faisons consiste à fabriquer<em> ensemble</em> des analyses de la société, donc de la pensée politique, à partir de la légitimité que l’on se donne à penser que l’on a compris des éléments de cette société. Donc c’est une posture d’illégitimité radicale et ça consiste à construire de la légitimité. Cela ne peut pas fonctionner avec un sachant et un apprenant. C’est pour cela que, à mon sens, <a href="https://fr.wikipedia.org/wiki/Michel_Onfray" target="_blank">Michel Onfray </a>ne fait pas d’éducation populaire. Ce qu’il fait est très bien, des conférences passionnantes, libres, ouvertes à tout le monde, mais ce n’est pas de l’éducation populaire : c’est de l’université ouverte. Ce serait de l’université populaire s’il partait des gens et pas de son savoir. Il ne fabrique pas du savoir avec les autres.</p>
  <div id="attachment_4696" class="wp-caption alignnone"><img class="wp-image-4696 size-full" src="https://www.revue-ballast.fr/wp-content/uploads/2015/06/ranciere-j.jpg" alt="ranciere-j" width="957" height="318" /><p class="wp-caption-text">Jacques Rancière (DR)</p></div>
  <p><strong>Dans votre conférence sur l’éducation, vous expliquez que l’école se donne comme vocation de préparer les jeunes à entrer sur le marché du travail et que certains politiciens affirment qu’il faut augmenter le niveau de connaissance comme réponse au chômage. Pourquoi, selon vous, est-ce une erreur ?</strong></p>
  <p>Le fait de hausser le niveau des gens ne sert à rien, s’il n’y a pas en face la structure d’emploi pour accueillir ces compétences. Et, aujourd’hui, le problème se situe du côté du marché du travail. Le problème est que ce que l’on appelle pudiquement « marché du travail » délocalise toute la production à l’étranger — et donc tous les emplois qualifiés. Il ne reste plus que les emplois sans aucune qualification, pour lesquels il n’y a même pas besoin d’aller à l’école, ou les emplois extrêmement qualifiés. On garde les ingénieurs en recherche et développement par stratégie politique parce qu’on veut garder « l’intelligence » ici et on garde certains emplois non qualifiés (qui sont de toutes façons non délocalisables), mais tout ce qu’il y a entre les deux, on le dégage ! On voit d’ailleurs que l’école qualifie très bien des gens mais que le marché du travail est absent — et de plus en plus absent ! Le problème n’est pas du côté de l’école. Je trouve très éclairante la statistique selon laquelle un bachelier d’aujourd’hui a le niveau d’instruction d’un ingénieur de 1953 : il y a un immense saut qualitatif qui a été réalisé. Quand je travaillais en foyer de jeunes travailleurs, des électriciens me disaient qu’ils savaient ce qu’étaient des électrons et comment ils fonctionnaient, mais qu’on ne leur proposait comme emploi que d’aller changer des ampoules chez Carrefour. Ils se demandaient pourquoi on leur avait appris cela puisqu’ils ne pouvaient pas s’en servir… Le problème est du côté de l’organisation du travail et de la propriété privée des moyens de production qui permettent les délocalisations. Si nous étions émancipés de ce que Bernard Friot appelle<a href="http://www.reseau-salariat.info/4d29e538abf28afeb66116df9f87c3c7?lang=fr" target="_blank"> « <em>la propriété lucrative</em> »</a> grâce à la copropriété d’usage des moyens de production, nous pourrions réinvestir dans l’organisation du travail ce que nous avons appris à l’école — ce qui, pour l’instant, est impossible. Quand les politiques vont tenter de monter de niveau d’apprentissage, ce sera le cas uniquement pour quelques-uns, en créant des écoles pour des élites. On cassera complètement l’éducation nationale telle qu’on la connaît aujourd’hui — ce qui laissera encore plus de gosses, en particulier issus des classes populaires, au bord de la route.</p>
  <p><strong>Dans quelle mesure pensez-vous que l’école d’aujourd’hui prépare les jeunes à l’acceptation du système néolibéral et de ses valeurs ?</strong></p>
  <blockquote>
  <p><strong>« L’école est de plus en plus sélective. Elle a calqué ses méthodes d’enseignement sur la logique du <em>management</em> d’entreprise. »</strong></p>
  </blockquote>
  <p>L’école est de plus en plus sélective. Elle a calqué ses méthodes d’enseignement sur la logique du <em>management</em> d’entreprise — par exemple, en adoptant la<a href="https://fr.wikipedia.org/wiki/P%C3%A9dagogie_de_projet" target="_blank"> « pédagogie par projets »</a> ou en adoptant le discours des compétences. C’est une école qui fabrique des travailleurs adaptables et pas du tout des esprits critiques qui se syndiqueront et feront des grèves. Les méthodes pédagogiques par projets se présentent toujours sous un angle généreux (comme le travail en équipe) mais calquent complètement le modèle néolibéral de l’entreprise afin de fabriquer des individus extrêmement autonomes et pas du tout des collectifs, qui risquent de devenir contestataires et de s’organiser dans la critique, si besoin.</p>
  <p><strong>Pouvez-vous nous parler du projet de l’Union européenne concernant  l’école ?</strong></p>
  <p>Le schéma est très simple : c’est la disparition des services publics d’éducation, de toutes les éducations nationales — pas seulement en Europe, d’ailleurs, mais partout dans le monde. C’est limpide, cela apparaît partout. C’est le transfert vers ce que l’on appelle « le marché éducatif », à savoir des opérateurs privés d’éducation. Et les logiciels vont jouer un rôle majeur dans ce processus. Il est quasiment inévitable, parce que c’est déjà prêt, que les apprentissages vont se faire sur Internet via des logiciels. On voit que l’on peut effectivement apprendre des choses seul, sans maître et sur Internet (nous le faisons tous), et ce sera le logiciel qui évaluera la progression de l’élève dans l’apprentissage de la matière. Les professeurs n’ont pas du tout conscience qu’ils vont disparaître ! Cela leur semble surréaliste car ils pensent être indispensables. Mais cela arrivera tellement vite qu’ils n’auront probablement pas le temps de s’organiser pour y répondre. Décalons le problème. Il y avait jusque dans les années 2000 un service public du chômage : l’ANPE. Il y avait des conseillers qui venaient comprendre la situation du demandeur d’emploi pour tenter de l’aider, de l’orienter, et qui avaient tout le temps nécessaire pour ce faire. On a supprimé l’ANPE et fait fusionner « le crocodile » (le comptable) et « l’éléphant » (le conseiller) en associant les ASSEDIC. Et, en général, quand on associe un crocodile et un éléphant, c’est plutôt le crocodile qui a le dessus.</p>
  <div id="attachment_4700" class="wp-caption alignnone"><img class="wp-image-4700 size-full" src="https://www.revue-ballast.fr/wp-content/uploads/2015/06/finkielkraut.jpg" alt="finkielkraut" width="957" height="318" /><p class="wp-caption-text">Alain Finkielkraut (DR)</p></div>
  <p>Aujourd’hui, le résultat est un service quasiment privé qui est Pôle Emploi, dans lequel les « opérateurs » ont exactement vingt minutes, surveillées informatiquement, pour remplir des formulaires et pour orienter les gens qu’ils entendent vers des prestataires privés de formation. Le rôle d’un conseiller de Pôle Emploi consiste désormais à faire rentrer les demandeurs d’emploi dans un algorithme, en fonction de son parcours et de ses compétences, qui l’orientera ensuite vers l’un de ces prestataires privés, qui sont financés pour réaliser des formations qui, bien souvent, ne servent à rien du tout. On a ici un excellent exemple de la façon dont un service public est transformé en un service privé. Prenons le cas de Manpower : cette entreprise peut réaliser une convention avec une mission locale et sur, par exemple, les 350 demandeurs d’emploi, repérer ceux qui sont le plus facilement et rapidement employables. Admettons qu’il y en ait 150. Elle les récupère, facture une somme tout à fait honorable à l’État pour les caser sur le marché et va sortir des résultats tout à fait meilleurs que la mission locale. Il reste 200 clampins sur le carreau, qui sont les personnes qui se trouvent dans les plus grandes difficultés sociales et personnelles. Ensuite, on pourra vous dire que le privé marche mieux que le service public. Je pense que c’est exactement comme cela que ça va se passer pour l’éducation. Il va y avoir des prestataires privés qui recruteront les bons élèves et il restera une forme d’éducation nationale pour s’occuper des mauvais élèves et leur trouver un boulot, pour balayer les cheveux chez le coiffeur. Voilà, c’est ça le projet.</p>
  <p><strong>Et si on vous demandait de faire des propositions de réforme de l’éducation nationale pour éviter la reproduction des inégalités de classe, quelles seraient-elles ?</strong></p>
  <blockquote>
  <p><strong>« Il faudrait affirmer de façon extrêmement claire qu’il n’y a aucun rapport entre l’école et le marché du travail et qu’elle n’a pas à s’occuper de cela. »</strong></p>
  </blockquote>
  <p>Réouvrir toute la réflexion des années 1970. Vous voyez bien la difficulté, puisqu’il s’agirait de rechanger complètement l’école et non de constamment la rafistoler et la sauver. Il faudrait affirmer de façon extrêmement claire qu’il n’y a aucun rapport entre l’école et le marché du travail et qu’elle n’a pas à s’occuper de cela ; il faudrait refaire une école qui fabrique des citoyens critiques, et donc politiques. Bon, vous imaginez bien la réaction des parents, des enseignants et des syndicats ! Mais c’est la seule solution pour garder un service public d’éducation, sauf à vouloir que cela devienne une filiale de Pôle Emploi. Et cela suppose de revenir sur la plupart des fondamentaux :  cela devrait être le rôle de l’éducation populaire de s’occuper urgemment de l’école. Il faut par ailleurs supprimer le système des notes, qui reproduit les inégalités sociales, et supprimer le baccalauréat, afin de permettre à chaque Français d’avoir accès à l’enseignement supérieur de son choix. N’importe quelle personne de n’importe quel âge doit pouvoir accéder à l’université. Une mère de famille qui a élevé cinq gosses, si elle a envie de faire une licence de sociologie ou d’histoire, doit pouvoir le faire. Les plus conservateurs se rebiffent face à tout ceci, mais ils se réveilleront trop tard. Ensuite, ils iront adhérer aux écoles d’élites. Les conseils régionaux vont mettre de l’argent là-dessus puisqu’ils savent que l’attractivité d’un territoire est liée au nombre d’élites qui s’y trouvent. Actuellement, les conseils régionaux financent les lycées mais ils ont seulement le droit de faire de beaux bâtiments, sans pouvoir toucher à l’enseignement — ils n’attendent que ça ! Et le jour où on leur transférera la compétence éducative, ils auront de nouveau de supers professeurs, ils augmenteront les salaires pour attirer les meilleurs et cela fonctionnera, car, aujourd’hui, les professeurs sont mal payés, ne se sentent pas reconnus et travaillent dans de mauvaises conditions. On ne leur donnera que les « gosses qui vont bien » et ils pourront enfin enseigner dans de bonnes conditions la géographie ou les mathématiques. Et Finkielkraut et Debray diront : « <em>Ah, enfin, on reconnaît les maîtres !</em> »</p>
  <p><strong>Mais il y a quand même beaucoup d’enseignants syndiqués, dans l’éducation nationale.</strong></p>
  <blockquote>
  <p><strong>« N’importe quelle personne de n’importe quel âge doit pouvoir accéder à l’université. Une mère de famille qui a élevé cinq gosses, si elle a envie de faire une licence de sociologie ou d’histoire, doit pouvoir le faire. »</strong></p>
  </blockquote>
  <p>On prendra les syndicats dans le sens du poil. On va revaloriser le salaire des enseignants. Les syndicats d’enseignants, comme beaucoup d’autres syndicats, ne sont pas sur le fond : ils sont sur la préservation du statut. Ils sont pris dans un dilemme dans lequel, s’ils vont sur le fond, ils pensent qu’ils vont mettre en danger leur statut. Je l’ai vu avec le syndicat d’éducation populaire, celui de jeunesse et sport. Critiquer le contenu de ce que font les agents, dire que c’est aberrant, cela signifie, pour eux, mettre en danger l’existence même du corps. Ils préfèrent ne pas se positionner sur le contenu et défendre mordicus les statuts. Les syndicats sont les derniers lieux qui interrogent le sens même de l’acte éducatif, alors que cela devrait être à eux de le faire. C’est tabou ! Nous l’avons vu récemment : quand <a href="https://fr.wikipedia.org/wiki/Najat_Vallaud-Belkacem" target="_blank">Najat Vallaud-Belkacem </a>a suggéré d’ouvrir le débat sur les notes et de remplacer les notations sur 20 par des notations de type ABCDEF (vous voyez la révolution : au lieu d’avoir 16, vous aurez B !), les syndicats se sont immédiatement opposés en disant qu’il était impensable de toucher aux notes. Les syndicats les défendent car elles symbolisent le pouvoir de l’enseignant, alors que les syndicats devraient être les premiers à demander leur suppression. Les syndicats ne défendent pas le métier d’enseignant, mais le statut. S’ils le défendaient, ils entendraient la plainte des enseignants du primaire qui hurlent, dans les ateliers que l’on organise, leur solitude et leur désarroi de n’avoir aucun appui syndical. Ils disent faire un métier de dingue, dans des conditions atroces.</p>
  <div id="attachment_4702" class="wp-caption alignnone"><img class="wp-image-4702 size-full" src="https://www.revue-ballast.fr/wp-content/uploads/2015/06/nvb.jpg" alt="nvb" width="957" height="318" /><p class="wp-caption-text">Najat Vallaud-Belkacem (DR)</p></div>
  <p>Il y a un vrai déni syndical de la souffrance. Ce que nous allons tenter de faire avec l’Ardeur, notre association, c’est précisément de refaire du syndicalisme, tel qu’il devrait être fait, c’est-à-dire de l’éducation populaire. Nous voulons travailler avec les gens à partir de ce qu’ils vivent comme souffrance, comme analyseur du métier. Nous avons été sollicités par les éducateurs en milieu ouvert, qui sont actuellement en grande souffrance. Depuis une quinzaine d’années, on a modifié leur métier en le remplaçant par des protocoles : ils doivent faire de la traçabilité, il y a tout un <em>management</em> par la compétence qui s’est mis en place, ils doivent travailler dans des conventions pluri-annuelles d’objectifs et de moyens, ils doivent justifier le nombre de gosses suivis et, peu à peu, cela tue le métier… Nous leur avons dit que la première chose à faire était de repartir sur ce qui fait sens pour eux : s’ils pensaient avoir un vrai métier, les conditions pour exercer vraiment ce métier et s’ils se pensaient capables de le redéfinir. Un métier, c’est quelque chose que l’on peut faire collectivement — sans cela, c’est une compétence. Et, aujourd’hui, on demande aux enseignants de se démerder seuls dans leur classe.</p>
  <p><strong>À quoi attribuez-vous la transformation de l’image de l’instituteur, par rapport à celle que l’on pouvait avoir dans les années 1950, qui donne parfois le sentiment que les enseignants sont davantage méprisés ?</strong></p>
  <blockquote>
  <p><strong>« Cette violence du capitalisme, les gens ne la dirigent pas contre les vrais responsables,  mais contre l’école. La figure de l’enseignant devient celle de la raison pour laquelle mon fils ne réussit pas. »</strong></p>
  </blockquote>
  <p>Je ne suis pas sûr qu’il y ait un mépris. Je dirais presque le contraire. Il y a une attente encore plus forte vis-à-vis des professeurs, et c’est pour cela qu’ils se font engueuler, d’ailleurs. En Guadeloupe, le prof est sacré : il y a de la pauvreté, pas de perspectives d’avenir et l’on attend tout de l’école — ce qui est aberrant. Le changement de statut de l’instituteur tient, à mon avis, au fait que l’école a monté le niveau culturel. Dans une société massivement industrielle, dans laquelle la plupart des emplois sont dans ce secteur, il n’y a pas besoin d’un haut niveau culturel puisque vous allez bosser à l’usine ou dans les champs. La culture, c’est alors une chose extrêmement impressionnante. Plus on va vers une société de services (qui est une société où les métiers sont de plus en plus liés à la culture), plus l’industrie commence à être le parent pauvre — surtout lorsqu’elle est délocalisée, surtout lorsque la grande majorité des emplois sont des emplois de relation. On rentre alors dans ce qu’on appelle le « capitalisme culturel <em>»</em>, où les gens sont tout à fait qualifiés et compétents grâce à l’école ; on arrive dans une société de services où il existe néanmoins un problème apparent, qui est celui du chômage et des difficultés d’insertion, alors que le pays regorge de richesses. Cette violence du capitalisme, les gens ne la dirigent pas contre les vrais responsables,  mais contre l’école. La figure de l’enseignant devient celle de la raison pour laquelle mon fils ne réussit pas. Les enseignants deviennent des ennemis, surtout lorsqu’ils se mettent à enseigner véritablement. Mais on se trompe d’ennemi !</p>
  <p>La question de l’école est donc d’une ambiguïté considérable. D’où l’urgence de multiplier partout des discussions concrètes sur l’école. Il faut faire de la <a href="https://fr.wikipedia.org/wiki/Recherche-action" target="_blank"><em>recherche-action</em> </a>et arrêter les soirées-débats qui ne font que donner bonne conscience à ceux qui les organisent. Il ne suffit pas d’être conscientisé. La pensée critique est une condition nécessaire mais non suffisante du changement. Sinon, tous les professeurs qui liraient <a href="https://fr.wikipedia.org/wiki/Pierre_Bourdieu" target="_blank">Bourdieu</a>, Rancière ou <a href="https://fr.wikipedia.org/wiki/Alain_Badiou" target="_blank">Badiou</a> donneraient leur démission le lendemain, et le problème serait réglé. Pour qu’il y ait changement dans une institution, il faut pouvoir faire de l’expérimentation. Les profs qui viennent voir mes conférences peuvent en sortir convaincus par l’idée que les notes sont de la connerie, mais, le lendemain, ils recommenceront à en mettre. Ou alors, il s’agit d’un héros qui va sans tarder se prendre les parents, les élèves, les collègues, l’inspecteur et tout le monde sur la gueule ! La seule possibilité pour que des enseignants puissent cesser de mettre des notes, et négocient un autre système d’évaluation qui deviendrait intelligent, ce serait qu’ils puissent expérimenter autre chose, dans des conditions protégées — c’est-à-dire avec le droit de le faire, tout en s’inscrivant dans la durée. Dans ces conditions, on pourrait commencer à dépositionner les pratiques. Mais ça, on ne l’a jamais fait.</p>
  <div id="attachment_4714" class="wp-caption alignnone"><img class="wp-image-4714 size-full" src="https://www.revue-ballast.fr/wp-content/uploads/2015/06/lordon.jpg" alt="lordon" width="957" height="318" /><p class="wp-caption-text">Frédéric Lordon (©Baltel / SIPA)</p></div>
  <p>J’en veux aux soirées-débats. Elles fabriquent, certes, du temps de cerveau disponible pour la révolution, mais la seule utilité, pour l’instant, de gugusses comme Franck Lepage, <a href="https://fr.wikipedia.org/wiki/Fr%C3%A9d%C3%A9ric_Lordon" target="_blank">Frédéric Lordon</a>, Bernard Friot ou<a href="https://fr.wikipedia.org/wiki/%C3%89tienne_Chouard" target="_blank"> Étienne Chouard</a>, c’est qu’il y a des centaines de milliers de jeunes qui sont en train de s’instruire sur la manière dont fonctionne le capitalisme, sur l’illégitimité de la dette, etc. Mais ça ne fait pas mouvement ! Il n’y a pas d’organisation derrière, ça ne change rien. Cela va sûrement servir quand ça va péter, et encore… Car quand ça va péter, mais c’est un autre débat, ça va péter dans les banlieues, chez les classes populaires, et, grâce à <em>Charlie</em>, les classes moyennes ne se solidariseront pas. Le Parti socialiste a réussi un tour de force : remplacer un problème de lutte des classes en un problème de lutte des races. On a des milliers de jeunes, y compris parmi ceux qui vont chercher des réponses chez quelqu’un comme <a href="https://fr.wikipedia.org/wiki/Alain_Soral" target="_blank">Soral</a>, qui « cherchent », qui tentent de comprendre un système qui n’est plus expliqué par les organisations de la « gauche » traditionnelle.</p>
  <blockquote>
  <p><strong>« S’il y a une insurrection, il y aura des tas de gens disponibles, et instruits sur le capitalisme (pour le meilleur — Lordon — et pour le pire — Soral). »</strong></p>
  </blockquote>
  <p>S’il y a une insurrection, il y aura des tas de gens disponibles, et instruits sur le capitalisme (pour le meilleur — Lordon — et pour le pire — Soral), mais, en l’absence de cette insurrection, changer l’école, transformer les dispositifs d’insertion, cela ne peut se faire qu’à l’intérieur des dispositifs eux-mêmes. Et pour que ces institutions se dépositionnent, il ne suffit pas qu’elles sachent. Quand tu vas dire à un chargé de mission d’insertion qu’il fait de la merde, tout ce que tu fais c’est le rendre plus malheureux : il le sait déjà. Et toi tu t’en vas, tu lui as mis ça dans la tête, et le lendemain il retourne faire son boulot de merde… Quand un centre social m’a invité et qu’il se montre ensuite ravi d’avoir présenté ma conférence, je leur demande s’ils vont proposer à tous les enseignants du coin de se réunir, tous les premiers lundi de chaque mois, pour continuer le travail. Parce que, si eux ne lancent pas l’invitation, ça ne se fera pas. Et ils ne le font jamais. C’est toute la fausseté de cette liberté d’expression. Cette forme de liberté d’expression qui ne sert à rien. C’est pour ça que l’on crée l’Ardeur et que <a href="http://www.scoplepave.org/" target="_blank">Le Pavé</a> explose. Depuis sept ans, Le Pavé ne fait que de la sensibilisation. Et maintenant, on arrête. On veut travailler dans la durée avec des gens, des institutions. On a choisi les syndicats, on va travailler avec ce levier-là. Sinon, on ne fait que de la sophrologie gauchiste. Ce n’est pas inutile, mais bon…</p>
  <hr /><p>Portrait-vignette de Franck Lepage : Sarah Kilani</p>
  <hr /><p><strong>NOTES</strong></p>
  <p><strong>1. </strong>« Franck Lepage. Coluche bourdieusien », portrait dans <em>Libération</em>, 8 juin 2014.<br /><strong> 2.</strong> « Franck Lepage. De l’éducation populaire à la domestication par la « culture »», <em>Le Monde Diplomatique</em>, Mai 2009.<br /><strong> 3.</strong> Entretien de Patrick Cohen avec Régis Debray, dans La Matinale de France Inter, 28 avril 2015.<br /><strong> 4</strong>. Entretien avec Jacques Rancière à propos de l’ouvrage <em>Le Maître ignorant</em>, <em>Nouveaux Regards</em>, n°28, janvier-mars 2005.</p>
  								<p>
  							Publié le 22 juin 2015
  							dans <a href="https://www.revue-ballast.fr/category/politique/" rel="category tag">Politique</a>							
  								par								
  							
  							                            						</p>


title: A Miserable Debt Free Life
url: http://www.rowetel.com/?p=4316
created_at: 2017-08-10 23:18:41
updated_at: 2017-08-10 23:18:41
mimetype: text/html
language: en-US
domain_name: www.rowetel.com
http_status: 200
content:
  <p>I have a lifestyle that is different to many people, and I have been encouraged to write about it.  According to my friends, I am “living the dream”.  I get up in the morning and can choose to do anything I want.  I don’t work for money any more.  I’ve been able to do this since I was 38 (I’m 48 now).  I don’t appear to want for anything (material).</p>
  <p>This is not a HowTo on retiring young, just a little about my story.  Use it as a source of ideas.</p>
  <p>Ten years ago I had an executive job in the sat-com industry, and prior to that I had a moderately successful small business, and a stint in academia.  Although I was an effective manager, small businessman, and engineer, I was consistently dissatisfied.  I did enjoy some parts of these jobs: Digital Signal Processing (DSP), open source, helping people, engineering, teaching thereof, annoying my managers, doing coffee and extremely long pub lunches.  Rather than knuckle under and be a good corporate lad I decided to to focus on what I enjoyed most.  Especially the coffee and pub lunches.</p>
  <p>So I quit corporate life to be a full time “hacker”.  I use the term hacker in the positive sense: I develop clever technology. Then, rather than using it to make a profit, I give the technology away in the hope that it will help people.  I’ve had <a href="http://www.rowetel.com/?page_id=434">some success at this goal</a> over the last 10 years.</p>
  <p>My corporate wardrobe is now my pajamas.  I spend most of the day sitting on my couch (thanks Dave for the couch BTW!) hacking on my laptop, with daily forays on my bike to a cafe by the beach.  This gets me exercise, some social connection, and caffeine.</p>
  <p>Once a month I travel interstate to a friends house, borrow their bike, cook for them, and sit on <strong>their</strong> couch and hack.  Mixing a bit of travel with my “work”.</p>
  <p>At the moment I average 6 hours of real, focused, head over the laptop work a day.  Which is the equivalent of 2 days in a “real job” where you have meetings, managers to annoy, and pub lunches to attend.</p>
  <p><strong>Influences</strong></p>
  <ul><li>In my final years of corporate life I listened to podcasts about using technology to help people by a guy called <a href="https://en.wikipedia.org/wiki/David_Bornstein_%28author%29">David Bornstein</a>.  This idea was quite appealing, a good use of my skills.</li>
  <li>At the same time a couple of friends (Scott and Horse) put the idea in my head of lifestyles not aimed merely at continual material accumulation.  One of them had paid off his house but didn’t see any reason to “upgrade” with more debt; the other just bailed on an engineering career to play volleyball and guitar, living off his savings for a bit. Huh?  I found myself admiring them.</li>
  <li>Volunteer work my Father did for disabled people.</li>
  <li>A book called <a href="https://en.wikipedia.org/wiki/Affluenza:_When_Too_Much_is_Never_Enough">Affluenza</a> by Clive Hamilton, which deals with our growing addiction to materialistic lifestyles.</li>

  <li>Travel.  Especially to the developing world, Timor Leste, India, townships in South Africa.</li>
  </ul><p><strong>But How Do You Get Money to Live?</strong></p>
  <p>Money you need = income – how much you spend.</p>
  <p>I live frugally, but am always happy to spend money on my kids (for stuff they really need) or entertaining friends.  Most nights I dine in rather than going out, and can cook a bunch of meals in 10 minutes that feed 4 people for $10.</p>
  <p>My living costs (including food, bills, housing, schooling, medical, transport) are about $40,000/pa, before any discretionary purchases like new IT or holidays.  That is for a household of 2.5 people (I share care of one child).</p>
  <p>I drive an <a href="http://www.rowetel.com/?page_id=17">electric car</a> which costs very little to drive and maintain, which I supplement with the occasional loan/rental of petrol cars.</p>
  <p>My kids go to public schools; my peers spend up to $40k/year on private education.  I am home every day for them when school ends, can help them in almost any subject (although they never ask of course as I am their Dad), and attend every interview to monitor their progress at school.</p>
  <p>I am not convinced there is any significant advantage from private schools, but acknowledge the emotional buttons and peer group pressure around private education is strong for many parents.  My kids are doing pretty well, e.g. one at University, another getting good grades at the best science and maths school in the state.</p>
  <p>I get income from a variety of sources, but the total is rather low compared to my peers.  And that’s OK. Currently there is some income from <a href="http://www.rowetel.com/?page_id=3902">SM1000</a> sales.  In the past it’s been from VOIP products like the IP0X VOIP systems and a little contract work.  I have some passive income from shares, enough to cover my rent.  So it’s a bit like owning my home.  These shares have been accumulated over 20 years simply by saving and reinvesting.  No get rich quick schemes here.</p>
  <p>Planning is good if you want to get somewhere. Here is a simple financial plan, start with $10k, start saving $100/week (5% more every year), invest at 10% (you get to work out where).  Repeat for 20 years and you have enough to buy a house, or generate some passive income.  Yes I know it doesn’t include inflation, and returns vary over time, blah, blah, blah.  Your turn – come up with a model that does include these factors.</p>
  <p style="text-align: center;"><img src="http://www.rowetel.com/images/save_and_invest.png" alt="image" /></p>
  <p>In Australia the government gives much of the population “middle class welfare”, a few $100/week which covers much of my food and bills.  We also have free public health care.  So the country you live in helps.  On the down side the houses here are really expensive to buy, an average of $500,000 (10 years average income), and public transport poor.  Every country has it’s pros and cons.</p>
  <p>I have modest financial skills and good habits.  Primarily the ability to spend less than I earn and avoidance of debt.  I use a trusted share broker to choose conservative shares, but I decide the overall strategy.  Some people like real estate for investment, it doesn’t really matter.  </p>
  <p>Saving and time is the key.  Conversely if you can’t save, it doesn’t matter if you earn $200k.  At the end of your time you will have nothing but a pile of debt, useless possessions, an endless need to work hard, broken relationships, and stress.</p>
  <p>Every few years I go without income and live off savings for 12 months while I develop a new product.  Living off savings for a while has ceased to worry me.  However I understand most people are 1 pay cheque away from serious financial trouble.  How about you?  How long could you live without a pay cheque?  It’s a good check on your financial health.</p>
  <p><strong>Effective Altruism</strong></p>
  <p>I’ve recently realised that working for free to help people is Altruism.  So instead of traveling to a village to help less fortunate people I’d like to invent a widget (or part of a widget) that might let 1000’s of villages communicate.  Or something like that.  At the moment I’m focused on digital voice over HF radio that has many applications, e.g. in humanitarian and remote communications.  I’m inventing technology building blocks that let me help the world a little bit, and stretch my professional skills (it’s post doctoral R&amp;D in my field of signal processing).</p>
  <p>Now, if you can name an enterprise, you can engineer it.  Use numbers to make it better.</p>
  <p>So, I’m currently reading a book called <a href="http://www.mostgoodyoucando.com/">The Most Good You Can Do</a> by Peter Singer.  This guy is applying a numerical framework to “Effective Altruism”.  Engineering it.  For example he calculates the impact of donating a kidney (really!), or saving a persons life with $x versus preventing blindness in 10 people with the same $x.  Is it better to work for 200k and donate 150 to a charity, or work for 50k in the same charity? Quite an easy to read book, but some fascinating ideas.</p>
  <p><strong>Thoughts</strong></p>
  <p>I have to think carefully and be sensitive to connect with the life of people with “real jobs”.  When my friends head off to work every day, it’s a mental shift for me to understand.  Yes I understand we need to be fed and housed. However I note a large portion of this work seems to be around paying for things we don’t really need, or making minimum payments on enormous debt.  Wage slavery?  But hey, my bank shares keep going up, and the dividends keep getting bigger, so who I am to question this system!</p>
  <p>Until age 38 I was very focused on material accumulation.  I had a Porsche 911 (called Helmut), several investment properties, and several pairs of trousers. At that stage I just ran out of things to buy. That was disconcerting for someone who came of age in the 1980’s.  It felt, inexplicably, like a miserable debt free life. So I had a bit of a think. It’s taken me a little while to shift my attitude to money, however I am gradually letting go.  Old habits die hard.  I still feel bad when not saving and accumulating.</p>
  <p style="text-align: center;"><img src="http://www.rowetel.com/images/helmut.jpg" alt="image" /></p>
  <p>Re money all you need is the ability to save and time.  Many people seem compelled to piss every cent they get down the drain.  This is encouraged by the “growth paradigm” that governments push, easy debt, materialism, and lack of financial literacy.</p>
  <p>Here is how I’m <a href="http://www.rowetel.com/?p=12">making my kids rich</a>.  It’s working too – they are in a better position than I was at their age and a million miles ahead of their peers.  Or for that matter a lot of people my age (30 years older than them).  It’s not just their net worth either: I get them involved, building their skills in handling money and investing.  Showing a 9 year old a dividend statement.  Getting a 17 year old to build a spreadsheet predicting growth of his assets over 10 years.  Giving a child part of my web business to run.  Making them wait for new material possessions.  Not giving them everything they want, of that their friends have. Forming good habits early.</p>
  <p>I struggle with the idea of debt for non-essential items, or huge, barely serviceable debt that is impossible to pay down quickly.  Certainly not for a bigger house or a $500 outfit or gadgets “paid” for on a credit card.  Or strongly depreciating items like cars (unless it’s electric of course). Useless debt turns the financial model above on it’s head.  If you waste $100/week now YOU get to pay the banks $500k over 20 years.  Then go back to work to do it again for another 20!</p>
  <p>I am very fortunate and feel I must help others with my good fortune.  We are all going to die one day.  Everything that matters to us, everything we ever owned, every problem we have – will all be dust.  Quickly forgotten, after a few kind words at your funeral.  However helping improve the lives of others matters. That can endure. I can’t imagine a life where I am not helping others.  Working just for more toys or my own needs is not enough.</p>
  <p>So now I’m going to sit on my couch, do some hacking, then give it away.</p>
  <p style="text-align: center;"><img src="http://www.rowetel.com/images/couchofpower.jpg" alt="image" /></p>
  <p>And no – you are not going to see me in my PJs!</p>
  <p><strong>Reading Further</strong></p>
  <p><a href="http://www.rowetel.com/?p=4420">A Miserable Debt Free Life Part 2</a></p>


title: request/request
url: https://github.com/request/request
created_at: 2017-08-10 23:18:47
updated_at: 2017-08-10 23:18:47
mimetype: text/html
language: en
domain_name: github.com
preview_picture: https://avatars1.githubusercontent.com/u/730467?v=4&s=400
http_status: 200
content:
  <h3>
        
        README.md
      </h3><p><a href="https://nodei.co/npm/request/"><img src="https://camo.githubusercontent.com/ca2eb1f11ce6d8f03babb72a74e962e3624913c2/68747470733a2f2f6e6f6465692e636f2f6e706d2f726571756573742e706e673f646f776e6c6f6164733d7472756526646f776e6c6f616452616e6b3d747275652673746172733d74727565" alt="npm package" /></a></p>
  <p><a href="https://travis-ci.org/request/request"><img src="https://camo.githubusercontent.com/16cf66fb5419c83391ce98044e110bc0d4ca1a46/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f726571756573742f726571756573742f6d61737465722e7376673f7374796c653d666c61742d737175617265" alt="Build status" /></a>
  <a href="https://codecov.io/github/request/request?branch=master"><img src="https://camo.githubusercontent.com/3ee6a5cf75bb197a7060f50b0b7b0344a9e26455/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f726571756573742f726571756573742e7376673f7374796c653d666c61742d737175617265" alt="Coverage" /></a>
  <a href="https://coveralls.io/r/request/request"><img src="https://camo.githubusercontent.com/8dec39beb579d8229ac767f2d28c7b20cebae815/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f726571756573742f726571756573742e7376673f7374796c653d666c61742d737175617265" alt="Coverage" /></a>
  <a href="https://david-dm.org/request/request"><img src="https://camo.githubusercontent.com/895093f8ef43722ff6c4bd61cd720199e76de812/68747470733a2f2f696d672e736869656c64732e696f2f64617669642f726571756573742f726571756573742e7376673f7374796c653d666c61742d737175617265" alt="Dependency Status" /></a>
  <a href="https://snyk.io/test/npm/request"><img src="https://camo.githubusercontent.com/c2f8fb14fb7b2016bf743f4edc9fed33916c2358/68747470733a2f2f736e796b2e696f2f746573742f6e706d2f726571756573742f62616467652e7376673f7374796c653d666c61742d737175617265" alt="Known Vulnerabilities" /></a>
  <a href="https://gitter.im/request/request?utm_source=badge"><img src="https://camo.githubusercontent.com/ce12c675f591354f6a093b49afee3828601ab688/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6769747465722d6a6f696e5f636861742d626c75652e7376673f7374796c653d666c61742d737175617265" alt="Gitter" /></a></p>
  <h2><a id="user-content-super-simple-to-use" class="anchor" href="https://github.com/request/request#super-simple-to-use"></a>Super simple to use</h2>
  <p>Request is designed to be the simplest way possible to make http calls. It supports HTTPS and follows redirects by default.</p>
  <div class="highlight highlight-source-js"><pre>var request = require('request');
  request('http://www.google.com', function (error, response, body) {
    console.log('error:', error); // Print the error if one occurred
    console.log('statusCode:', response &amp;&amp; response.statusCode); // Print the response status code if a response was received
    console.log('body:', body); // Print the HTML for the Google homepage.
  });</pre></div>
  <h2><a id="user-content-table-of-contents" class="anchor" href="https://github.com/request/request#table-of-contents"></a>Table of contents</h2>
  <ul><li><a href="https://github.com/request/request#streaming">Streaming</a></li>
  <li><a href="https://github.com/request/request#promises--asyncawait">Promises &amp; Async/Await</a></li>
  <li><a href="https://github.com/request/request#forms">Forms</a></li>
  <li><a href="https://github.com/request/request#http-authentication">HTTP Authentication</a></li>
  <li><a href="https://github.com/request/request#custom-http-headers">Custom HTTP Headers</a></li>
  <li><a href="https://github.com/request/request#oauth-signing">OAuth Signing</a></li>
  <li><a href="https://github.com/request/request#proxies">Proxies</a></li>
  <li><a href="https://github.com/request/request#unix-domain-sockets">Unix Domain Sockets</a></li>
  <li><a href="https://github.com/request/request#tlsssl-protocol">TLS/SSL Protocol</a></li>
  <li><a href="https://github.com/request/request#support-for-har-12">Support for HAR 1.2</a></li>
  <li><a href="https://github.com/request/request#requestoptions-callback"><strong>All Available Options</strong></a></li>
  </ul><p>Request also offers <a href="https://github.com/request/request#convenience-methods">convenience methods</a> like
  <code>request.defaults</code> and <code>request.post</code>, and there are
  lots of <a href="https://github.com/request/request#examples">usage examples</a> and several
  <a href="https://github.com/request/request#debugging">debugging techniques</a>.</p>
  <hr /><h2><a id="user-content-streaming" class="anchor" href="https://github.com/request/request#streaming"></a>Streaming</h2>
  <p>You can stream any response to a file stream.</p>
  <div class="highlight highlight-source-js"><pre>request('http://google.com/doodle.png').pipe(fs.createWriteStream('doodle.png'))</pre></div>
  <p>You can also stream a file to a PUT or POST request. This method will also check the file extension against a mapping of file extensions to content-types (in this case <code>application/json</code>) and use the proper <code>content-type</code> in the PUT request (if the headers don’t already provide one).</p>
  <div class="highlight highlight-source-js"><pre>fs.createReadStream('file.json').pipe(request.put('http://mysite.com/obj.json'))</pre></div>
  <p>Request can also <code>pipe</code> to itself. When doing so, <code>content-type</code> and <code>content-length</code> are preserved in the PUT headers.</p>
  <div class="highlight highlight-source-js"><pre>request.get('http://google.com/img.png').pipe(request.put('http://mysite.com/img.png'))</pre></div>
  <p>Request emits a "response" event when a response is received. The <code>response</code> argument will be an instance of <a href="https://nodejs.org/api/http.html#http_class_http_incomingmessage">http.IncomingMessage</a>.</p>
  <div class="highlight highlight-source-js"><pre>request
    .get('http://google.com/img.png')
    .on('response', function(response) {
      console.log(response.statusCode) // 200
      console.log(response.headers['content-type']) // 'image/png'
    })
    .pipe(request.put('http://mysite.com/img.png'))</pre></div>
  <p>To easily handle errors when streaming requests, listen to the <code>error</code> event before piping:</p>
  <div class="highlight highlight-source-js"><pre>request
    .get('http://mysite.com/doodle.png')
    .on('error', function(err) {
      console.log(err)
    })
    .pipe(fs.createWriteStream('doodle.png'))</pre></div>
  <p>Now let’s get fancy.</p>
  <div class="highlight highlight-source-js"><pre>http.createServer(function (req, resp) {
    if (req.url === '/doodle.png') {
      if (req.method === 'PUT') {
        req.pipe(request.put('http://mysite.com/doodle.png'))
      } else if (req.method === 'GET' || req.method === 'HEAD') {
        request.get('http://mysite.com/doodle.png').pipe(resp)
      }
    }
  })</pre></div>
  <p>You can also <code>pipe()</code> from <code>http.ServerRequest</code> instances, as well as to <code>http.ServerResponse</code> instances. The HTTP method, headers, and entity-body data will be sent. Which means that, if you don't really care about security, you can do:</p>
  <div class="highlight highlight-source-js"><pre>http.createServer(function (req, resp) {
    if (req.url === '/doodle.png') {
      var x = request('http://mysite.com/doodle.png')
      req.pipe(x)
      x.pipe(resp)
    }
  })</pre></div>
  <p>And since <code>pipe()</code> returns the destination stream in ≥ Node 0.5.x you can do one line proxying. :)</p>
  <div class="highlight highlight-source-js"><pre>req.pipe(request('http://mysite.com/doodle.png')).pipe(resp)</pre></div>
  <p>Also, none of this new functionality conflicts with requests previous features, it just expands them.</p>
  <div class="highlight highlight-source-js"><pre>var r = request.defaults({'proxy':'http://localproxy.com'})
  http.createServer(function (req, resp) {
    if (req.url === '/doodle.png') {
      r.get('http://google.com/doodle.png').pipe(resp)
    }
  })</pre></div>
  <p>You can still use intermediate proxies, the requests will still follow HTTP forwards, etc.</p>
  <p><a href="https://github.com/request/request#table-of-contents">back to top</a></p>
  <hr /><h2><a id="user-content-promises--asyncawait" class="anchor" href="https://github.com/request/request#promises--asyncawait"></a>Promises &amp; Async/Await</h2>
  <p><code>request</code> supports both streaming and callback interfaces natively. If you'd like <code>request</code> to return a Promise instead, you can use an alternative interface wrapper for <code>request</code>. These wrappers can be useful if you prefer to work with Promises, or if you'd like to use <code>async</code>/<code>await</code> in ES2017.</p>
  <p>Several alternative interfaces are provided by the request team, including:</p>
  <p><a href="https://github.com/request/request#table-of-contents">back to top</a></p>
  <hr /><h2><a id="user-content-forms" class="anchor" href="https://github.com/request/request#forms"></a>Forms</h2>
  <p><code>request</code> supports <code>application/x-www-form-urlencoded</code> and <code>multipart/form-data</code> form uploads. For <code>multipart/related</code> refer to the <code>multipart</code> API.</p>
  <h4><a id="user-content-applicationx-www-form-urlencoded-url-encoded-forms" class="anchor" href="https://github.com/request/request#applicationx-www-form-urlencoded-url-encoded-forms"></a>application/x-www-form-urlencoded (URL-Encoded Forms)</h4>
  <p>URL-encoded forms are simple.</p>
  <div class="highlight highlight-source-js"><pre>request.post('http://service.com/upload', {form:{key:'value'}})
  // or
  request.post('http://service.com/upload').form({key:'value'})
  // or
  request.post({url:'http://service.com/upload', form: {key:'value'}}, function(err,httpResponse,body){ /* ... */ })</pre></div>
  <h4><a id="user-content-multipartform-data-multipart-form-uploads" class="anchor" href="https://github.com/request/request#multipartform-data-multipart-form-uploads"></a>multipart/form-data (Multipart Form Uploads)</h4>
  <p>For <code>multipart/form-data</code> we use the <a href="https://github.com/form-data/form-data">form-data</a> library by <a href="https://github.com/felixge">@felixge</a>. For the most cases, you can pass your upload form data via the <code>formData</code> option.</p>
  <div class="highlight highlight-source-js"><pre>var formData = {
    // Pass a simple key-value pair
    my_field: 'my_value',
    // Pass data via Buffers
    my_buffer: new Buffer([1, 2, 3]),
    // Pass data via Streams
    my_file: fs.createReadStream(__dirname + '/unicycle.jpg'),
    // Pass multiple values /w an Array
    attachments: [
      fs.createReadStream(__dirname + '/attachment1.jpg'),
      fs.createReadStream(__dirname + '/attachment2.jpg')
    ],
    // Pass optional meta-data with an 'options' object with style: {value: DATA, options: OPTIONS}
    // Use case: for some types of streams, you'll need to provide "file"-related information manually.
    // See the `form-data` README for more information about options: https://github.com/form-data/form-data
    custom_file: {
      value:  fs.createReadStream('/dev/urandom'),
      options: {
        filename: 'topsecret.jpg',
        contentType: 'image/jpeg'
      }
    }
  };
  request.post({url:'http://service.com/upload', formData: formData}, function optionalCallback(err, httpResponse, body) {
    if (err) {
      return console.error('upload failed:', err);
    }
    console.log('Upload successful!  Server responded with:', body);
  });</pre></div>
  <p>For advanced cases, you can access the form-data object itself via <code>r.form()</code>. This can be modified until the request is fired on the next cycle of the event-loop. (Note that this calling <code>form()</code> will clear the currently set form data for that request.)</p>
  <div class="highlight highlight-source-js"><pre>// NOTE: Advanced use-case, for normal use see 'formData' usage above
  var r = request.post('http://service.com/upload', function optionalCallback(err, httpResponse, body) {...})
  var form = r.form();
  form.append('my_field', 'my_value');
  form.append('my_buffer', new Buffer([1, 2, 3]));
  form.append('custom_file', fs.createReadStream(__dirname + '/unicycle.jpg'), {filename: 'unicycle.jpg'});</pre></div>
  <p>See the <a href="https://github.com/form-data/form-data">form-data README</a> for more information &amp; examples.</p>
  <h4><a id="user-content-multipartrelated" class="anchor" href="https://github.com/request/request#multipartrelated"></a>multipart/related</h4>
  <p>Some variations in different HTTP implementations require a newline/CRLF before, after, or both before and after the boundary of a <code>multipart/related</code> request (using the multipart option). This has been observed in the .NET WebAPI version 4.0. You can turn on a boundary preambleCRLF or postamble by passing them as <code>true</code> to your request options.</p>
  <div class="highlight highlight-source-js"><pre>  request({
      method: 'PUT',
      preambleCRLF: true,
      postambleCRLF: true,
      uri: 'http://service.com/upload',
      multipart: [
        {
          'content-type': 'application/json',
          body: JSON.stringify({foo: 'bar', _attachments: {'message.txt': {follows: true, length: 18, 'content_type': 'text/plain' }}})
        },
        { body: 'I am an attachment' },
        { body: fs.createReadStream('image.png') }
      ],
      // alternatively pass an object containing additional options
      multipart: {
        chunked: false,
        data: [
          {
            'content-type': 'application/json',
            body: JSON.stringify({foo: 'bar', _attachments: {'message.txt': {follows: true, length: 18, 'content_type': 'text/plain' }}})
          },
          { body: 'I am an attachment' }
        ]
      }
    },
    function (error, response, body) {
      if (error) {
        return console.error('upload failed:', error);
      }
      console.log('Upload successful!  Server responded with:', body);
    })</pre></div>
  <p><a href="https://github.com/request/request#table-of-contents">back to top</a></p>
  <hr /><h2><a id="user-content-http-authentication" class="anchor" href="https://github.com/request/request#http-authentication"></a>HTTP Authentication</h2>
  <div class="highlight highlight-source-js"><pre>request.get('http://some.server.com/').auth('username', 'password', false);
  // or
  request.get('http://some.server.com/', {
    'auth': {
      'user': 'username',
      'pass': 'password',
      'sendImmediately': false
    }
  });
  // or
  request.get('http://some.server.com/').auth(null, null, true, 'bearerToken');
  // or
  request.get('http://some.server.com/', {
    'auth': {
      'bearer': 'bearerToken'
    }
  });</pre></div>
  <p>If passed as an option, <code>auth</code> should be a hash containing values:</p>
  <ul><li><code>user</code> || <code>username</code></li>
  <li><code>pass</code> || <code>password</code></li>
  <li><code>sendImmediately</code> (optional)</li>
  <li><code>bearer</code> (optional)</li>
  </ul><p>The method form takes parameters
  <code>auth(username, password, sendImmediately, bearer)</code>.</p>
  <p><code>sendImmediately</code> defaults to <code>true</code>, which causes a basic or bearer
  authentication header to be sent. If <code>sendImmediately</code> is <code>false</code>, then
  <code>request</code> will retry with a proper authentication header after receiving a
  <code>401</code> response from the server (which must contain a <code>WWW-Authenticate</code> header
  indicating the required authentication method).</p>
  <p>Note that you can also specify basic authentication using the URL itself, as
  detailed in <a href="http://www.ietf.org/rfc/rfc1738.txt">RFC 1738</a>. Simply pass the
  <code>user:password</code> before the host with an <code>@</code> sign:</p>
  <div class="highlight highlight-source-js"><pre>var username = 'username',
      password = 'password',
      url = 'http://' + username + ':' + password + '@some.server.com';
  request({url: url}, function (error, response, body) {
     // Do more stuff with 'body' here
  });</pre></div>
  <p>Digest authentication is supported, but it only works with <code>sendImmediately</code>
  set to <code>false</code>; otherwise <code>request</code> will send basic authentication on the
  initial request, which will probably cause the request to fail.</p>
  <p>Bearer authentication is supported, and is activated when the <code>bearer</code> value is
  available. The value may be either a <code>String</code> or a <code>Function</code> returning a
  <code>String</code>. Using a function to supply the bearer token is particularly useful if
  used in conjunction with <code>defaults</code> to allow a single function to supply the
  last known token at the time of sending a request, or to compute one on the fly.</p>
  <p><a href="https://github.com/request/request#table-of-contents">back to top</a></p>
  <hr /><h2><a id="user-content-custom-http-headers" class="anchor" href="https://github.com/request/request#custom-http-headers"></a>Custom HTTP Headers</h2>
  <p>HTTP Headers, such as <code>User-Agent</code>, can be set in the <code>options</code> object.
  In the example below, we call the github API to find out the number
  of stars and forks for the request repository. This requires a
  custom <code>User-Agent</code> header as well as https.</p>
  <div class="highlight highlight-source-js"><pre>var request = require('request');
  var options = {
    url: 'https://api.github.com/repos/request/request',
    headers: {
      'User-Agent': 'request'
    }
  };
  function callback(error, response, body) {
    if (!error &amp;&amp; response.statusCode == 200) {
      var info = JSON.parse(body);
      console.log(info.stargazers_count + " Stars");
      console.log(info.forks_count + " Forks");
    }
  }
  request(options, callback);</pre></div>
  <p><a href="https://github.com/request/request#table-of-contents">back to top</a></p>
  <hr /><h2><a id="user-content-oauth-signing" class="anchor" href="https://github.com/request/request#oauth-signing"></a>OAuth Signing</h2>
  <p><a href="https://tools.ietf.org/html/rfc5849">OAuth version 1.0</a> is supported. The
  default signing algorithm is
  <a href="https://tools.ietf.org/html/rfc5849#section-3.4.2">HMAC-SHA1</a>:</p>
  <div class="highlight highlight-source-js"><pre>// OAuth1.0 - 3-legged server side flow (Twitter example)
  // step 1
  var qs = require('querystring')
    , oauth =
      { callback: 'http://mysite.com/callback/'
      , consumer_key: CONSUMER_KEY
      , consumer_secret: CONSUMER_SECRET
      }
    , url = 'https://api.twitter.com/oauth/request_token'
    ;
  request.post({url:url, oauth:oauth}, function (e, r, body) {
    // Ideally, you would take the body in the response
    // and construct a URL that a user clicks on (like a sign in button).
    // The verifier is only available in the response after a user has
    // verified with twitter that they are authorizing your app.
    // step 2
    var req_data = qs.parse(body)
    var uri = 'https://api.twitter.com/oauth/authenticate'
      + '?' + qs.stringify({oauth_token: req_data.oauth_token})
    // redirect the user to the authorize uri
    // step 3
    // after the user is redirected back to your server
    var auth_data = qs.parse(body)
      , oauth =
        { consumer_key: CONSUMER_KEY
        , consumer_secret: CONSUMER_SECRET
        , token: auth_data.oauth_token
        , token_secret: req_data.oauth_token_secret
        , verifier: auth_data.oauth_verifier
        }
      , url = 'https://api.twitter.com/oauth/access_token'
      ;
    request.post({url:url, oauth:oauth}, function (e, r, body) {
      // ready to make signed requests on behalf of the user
      var perm_data = qs.parse(body)
        , oauth =
          { consumer_key: CONSUMER_KEY
          , consumer_secret: CONSUMER_SECRET
          , token: perm_data.oauth_token
          , token_secret: perm_data.oauth_token_secret
          }
        , url = 'https://api.twitter.com/1.1/users/show.json'
        , qs =
          { screen_name: perm_data.screen_name
          , user_id: perm_data.user_id
          }
        ;
      request.get({url:url, oauth:oauth, qs:qs, json:true}, function (e, r, user) {
        console.log(user)
      })
    })
  })</pre></div>
  <p>For <a href="https://tools.ietf.org/html/rfc5849#section-3.4.3">RSA-SHA1 signing</a>, make
  the following changes to the OAuth options object:</p>
  <ul><li>Pass <code>signature_method : 'RSA-SHA1'</code></li>
  <li>Instead of <code>consumer_secret</code>, specify a <code>private_key</code> string in
  <a href="http://how2ssl.com/articles/working_with_pem_files/">PEM format</a></li>
  </ul><p>For <a href="http://oauth.net/core/1.0/#anchor22">PLAINTEXT signing</a>, make
  the following changes to the OAuth options object:</p>
  <ul><li>Pass <code>signature_method : 'PLAINTEXT'</code></li>
  </ul><p>To send OAuth parameters via query params or in a post body as described in The
  <a href="http://oauth.net/core/1.0/#consumer_req_param">Consumer Request Parameters</a>
  section of the oauth1 spec:</p>
  <ul><li>Pass <code>transport_method : 'query'</code> or <code>transport_method : 'body'</code> in the OAuth
  options object.</li>
  <li><code>transport_method</code> defaults to <code>'header'</code></li>
  </ul><p>To use <a href="https://oauth.googlecode.com/svn/spec/ext/body_hash/1.0/oauth-bodyhash.html">Request Body Hash</a> you can either</p>
  <ul><li>Manually generate the body hash and pass it as a string <code>body_hash: '...'</code></li>
  <li>Automatically generate the body hash by passing <code>body_hash: true</code></li>
  </ul><p><a href="https://github.com/request/request#table-of-contents">back to top</a></p>
  <hr /><h2><a id="user-content-proxies" class="anchor" href="https://github.com/request/request#proxies"></a>Proxies</h2>
  <p>If you specify a <code>proxy</code> option, then the request (and any subsequent
  redirects) will be sent via a connection to the proxy server.</p>
  <p>If your endpoint is an <code>https</code> url, and you are using a proxy, then
  request will send a <code>CONNECT</code> request to the proxy server <em>first</em>, and
  then use the supplied connection to connect to the endpoint.</p>
  <p>That is, first it will make a request like:</p>
  <pre>HTTP/1.1 CONNECT endpoint-server.com:80
  Host: proxy-server.com
  User-Agent: whatever user agent you specify
  </pre>
  <p>and then the proxy server make a TCP connection to <code>endpoint-server</code>
  on port <code>80</code>, and return a response that looks like:</p>
  <pre>HTTP/1.1 200 OK
  </pre>
  <p>At this point, the connection is left open, and the client is
  communicating directly with the <code>endpoint-server.com</code> machine.</p>
  <p>See <a href="https://en.wikipedia.org/wiki/HTTP_tunnel">the wikipedia page on HTTP Tunneling</a>
  for more information.</p>
  <p>By default, when proxying <code>http</code> traffic, request will simply make a
  standard proxied <code>http</code> request. This is done by making the <code>url</code>
  section of the initial line of the request a fully qualified url to
  the endpoint.</p>
  <p>For example, it will make a single request that looks like:</p>
  <pre>HTTP/1.1 GET http://endpoint-server.com/some-url
  Host: proxy-server.com
  Other-Headers: all go here
  request body or whatever
  </pre>
  <p>Because a pure "http over http" tunnel offers no additional security
  or other features, it is generally simpler to go with a
  straightforward HTTP proxy in this case. However, if you would like
  to force a tunneling proxy, you may set the <code>tunnel</code> option to <code>true</code>.</p>
  <p>You can also make a standard proxied <code>http</code> request by explicitly setting
  <code>tunnel : false</code>, but <strong>note that this will allow the proxy to see the traffic
  to/from the destination server</strong>.</p>
  <p>If you are using a tunneling proxy, you may set the
  <code>proxyHeaderWhiteList</code> to share certain headers with the proxy.</p>
  <p>You can also set the <code>proxyHeaderExclusiveList</code> to share certain
  headers only with the proxy and not with destination host.</p>
  <p>By default, this set is:</p>
  <pre>accept
  accept-charset
  accept-encoding
  accept-language
  accept-ranges
  cache-control
  content-encoding
  content-language
  content-length
  content-location
  content-md5
  content-range
  content-type
  connection
  date
  expect
  max-forwards
  pragma
  proxy-authorization
  referer
  te
  transfer-encoding
  user-agent
  via
  </pre>
  <p>Note that, when using a tunneling proxy, the <code>proxy-authorization</code>
  header and any headers from custom <code>proxyHeaderExclusiveList</code> are
  <em>never</em> sent to the endpoint server, but only to the proxy server.</p>
  <h3><a id="user-content-controlling-proxy-behaviour-using-environment-variables" class="anchor" href="https://github.com/request/request#controlling-proxy-behaviour-using-environment-variables"></a>Controlling proxy behaviour using environment variables</h3>
  <p>The following environment variables are respected by <code>request</code>:</p>
  <ul><li><code>HTTP_PROXY</code> / <code>http_proxy</code></li>
  <li><code>HTTPS_PROXY</code> / <code>https_proxy</code></li>
  <li><code>NO_PROXY</code> / <code>no_proxy</code></li>
  </ul><p>When <code>HTTP_PROXY</code> / <code>http_proxy</code> are set, they will be used to proxy non-SSL requests that do not have an explicit <code>proxy</code> configuration option present. Similarly, <code>HTTPS_PROXY</code> / <code>https_proxy</code> will be respected for SSL requests that do not have an explicit <code>proxy</code> configuration option. It is valid to define a proxy in one of the environment variables, but then override it for a specific request, using the <code>proxy</code> configuration option. Furthermore, the <code>proxy</code> configuration option can be explicitly set to false / null to opt out of proxying altogether for that request.</p>
  <p><code>request</code> is also aware of the <code>NO_PROXY</code>/<code>no_proxy</code> environment variables. These variables provide a granular way to opt out of proxying, on a per-host basis. It should contain a comma separated list of hosts to opt out of proxying. It is also possible to opt of proxying when a particular destination port is used. Finally, the variable may be set to <code>*</code> to opt out of the implicit proxy configuration of the other environment variables.</p>
  <p>Here's some examples of valid <code>no_proxy</code> values:</p>
  <ul><li><code>google.com</code> - don't proxy HTTP/HTTPS requests to Google.</li>
  <li><code>google.com:443</code> - don't proxy HTTPS requests to Google, but <em>do</em> proxy HTTP requests to Google.</li>
  <li><code>google.com:443, yahoo.com:80</code> - don't proxy HTTPS requests to Google, and don't proxy HTTP requests to Yahoo!</li>
  <li><code>*</code> - ignore <code>https_proxy</code>/<code>http_proxy</code> environment variables altogether.</li>
  </ul><p><a href="https://github.com/request/request#table-of-contents">back to top</a></p>
  <hr /><h2><a id="user-content-unix-domain-sockets" class="anchor" href="https://github.com/request/request#unix-domain-sockets"></a>UNIX Domain Sockets</h2>
  <p><code>request</code> supports making requests to <a href="https://en.wikipedia.org/wiki/Unix_domain_socket">UNIX Domain Sockets</a>. To make one, use the following URL scheme:</p>
  <div class="highlight highlight-source-js"><pre>/* Pattern */ 'http://unix:SOCKET:PATH'
  /* Example */ request.get('http://unix:/absolute/path/to/unix.socket:/request/path')</pre></div>
  <p>Note: The <code>SOCKET</code> path is assumed to be absolute to the root of the host file system.</p>
  <p><a href="https://github.com/request/request#table-of-contents">back to top</a></p>
  <hr /><h2><a id="user-content-tlsssl-protocol" class="anchor" href="https://github.com/request/request#tlsssl-protocol"></a>TLS/SSL Protocol</h2>
  <p>TLS/SSL Protocol options, such as <code>cert</code>, <code>key</code> and <code>passphrase</code>, can be
  set directly in <code>options</code> object, in the <code>agentOptions</code> property of the <code>options</code> object, or even in <code>https.globalAgent.options</code>. Keep in mind that, although <code>agentOptions</code> allows for a slightly wider range of configurations, the recommended way is via <code>options</code> object directly, as using <code>agentOptions</code> or <code>https.globalAgent.options</code> would not be applied in the same way in proxied environments (as data travels through a TLS connection instead of an http/https agent).</p>
  <div class="highlight highlight-source-js"><pre>var fs = require('fs')
      , path = require('path')
      , certFile = path.resolve(__dirname, 'ssl/client.crt')
      , keyFile = path.resolve(__dirname, 'ssl/client.key')
      , caFile = path.resolve(__dirname, 'ssl/ca.cert.pem')
      , request = require('request');
  var options = {
      url: 'https://api.some-server.com/',
      cert: fs.readFileSync(certFile),
      key: fs.readFileSync(keyFile),
      passphrase: 'password',
      ca: fs.readFileSync(caFile)
  };
  request.get(options);</pre></div>
  <h3><a id="user-content-using-optionsagentoptions" class="anchor" href="https://github.com/request/request#using-optionsagentoptions"></a>Using <code>options.agentOptions</code></h3>
  <p>In the example below, we call an API that requires client side SSL certificate
  (in PEM format) with passphrase protected private key (in PEM format) and disable the SSLv3 protocol:</p>
  <div class="highlight highlight-source-js"><pre>var fs = require('fs')
      , path = require('path')
      , certFile = path.resolve(__dirname, 'ssl/client.crt')
      , keyFile = path.resolve(__dirname, 'ssl/client.key')
      , request = require('request');
  var options = {
      url: 'https://api.some-server.com/',
      agentOptions: {
          cert: fs.readFileSync(certFile),
          key: fs.readFileSync(keyFile),
          // Or use `pfx` property replacing `cert` and `key` when using private key, certificate and CA certs in PFX or PKCS12 format:
          // pfx: fs.readFileSync(pfxFilePath),
          passphrase: 'password',
          securityOptions: 'SSL_OP_NO_SSLv3'
      }
  };
  request.get(options);</pre></div>
  <p>It is able to force using SSLv3 only by specifying <code>secureProtocol</code>:</p>
  <div class="highlight highlight-source-js"><pre>request.get({
      url: 'https://api.some-server.com/',
      agentOptions: {
          secureProtocol: 'SSLv3_method'
      }
  });</pre></div>
  <p>It is possible to accept other certificates than those signed by generally allowed Certificate Authorities (CAs).
  This can be useful, for example,  when using self-signed certificates.
  To require a different root certificate, you can specify the signing CA by adding the contents of the CA's certificate file to the <code>agentOptions</code>.
  The certificate the domain presents must be signed by the root certificate specified:</p>
  <div class="highlight highlight-source-js"><pre>request.get({
      url: 'https://api.some-server.com/',
      agentOptions: {
          ca: fs.readFileSync('ca.cert.pem')
      }
  });</pre></div>
  <p><a href="https://github.com/request/request#table-of-contents">back to top</a></p>
  <hr /><h2><a id="user-content-support-for-har-12" class="anchor" href="https://github.com/request/request#support-for-har-12"></a>Support for HAR 1.2</h2>
  <p>The <code>options.har</code> property will override the values: <code>url</code>, <code>method</code>, <code>qs</code>, <code>headers</code>, <code>form</code>, <code>formData</code>, <code>body</code>, <code>json</code>, as well as construct multipart data and read files from disk when <code>request.postData.params[].fileName</code> is present without a matching <code>value</code>.</p>
  <p>A validation step will check if the HAR Request format matches the latest spec (v1.2) and will skip parsing if not matching.</p>
  <div class="highlight highlight-source-js"><pre>  var request = require('request')
    request({
      // will be ignored
      method: 'GET',
      uri: 'http://www.google.com',
      // HTTP Archive Request Object
      har: {
        url: 'http://www.mockbin.com/har',
        method: 'POST',
        headers: [
          {
            name: 'content-type',
            value: 'application/x-www-form-urlencoded'
          }
        ],
        postData: {
          mimeType: 'application/x-www-form-urlencoded',
          params: [
            {
              name: 'foo',
              value: 'bar'
            },
            {
              name: 'hello',
              value: 'world'
            }
          ]
        }
      }
    })
    // a POST request will be sent to http://www.mockbin.com
    // with body an application/x-www-form-urlencoded body:
    // foo=bar&amp;hello=world</pre></div>
  <p><a href="https://github.com/request/request#table-of-contents">back to top</a></p>
  <hr /><h2><a id="user-content-requestoptions-callback" class="anchor" href="https://github.com/request/request#requestoptions-callback"></a>request(options, callback)</h2>
  <p>The first argument can be either a <code>url</code> or an <code>options</code> object. The only required option is <code>uri</code>; all others are optional.</p>
  <ul><li><code>uri</code> || <code>url</code> - fully qualified uri or a parsed url object from <code>url.parse()</code></li>
  <li><code>baseUrl</code> - fully qualified uri string used as the base url. Most useful with <code>request.defaults</code>, for example when you want to do many requests to the same domain. If <code>baseUrl</code> is <code>https://example.com/api/</code>, then requesting <code>/end/point?test=true</code> will fetch <code>https://example.com/api/end/point?test=true</code>. When <code>baseUrl</code> is given, <code>uri</code> must also be a string.</li>
  <li><code>method</code> - http method (default: <code>"GET"</code>)</li>
  <li><code>headers</code> - http headers (default: <code>{}</code>)</li>
  </ul><hr /><ul><li><code>qs</code> - object containing querystring values to be appended to the <code>uri</code></li>
  <li><code>qsParseOptions</code> - object containing options to pass to the <a href="https://github.com/hapijs/qs#parsing-objects">qs.parse</a> method. Alternatively pass options to the <a href="https://nodejs.org/docs/v0.12.0/api/querystring.html#querystring_querystring_parse_str_sep_eq_options">querystring.parse</a> method using this format <code>{sep:';', eq:':', options:{}}</code></li>
  <li><code>qsStringifyOptions</code> - object containing options to pass to the <a href="https://github.com/hapijs/qs#stringifying">qs.stringify</a> method. Alternatively pass options to the  <a href="https://nodejs.org/docs/v0.12.0/api/querystring.html#querystring_querystring_stringify_obj_sep_eq_options">querystring.stringify</a> method using this format <code>{sep:';', eq:':', options:{}}</code>. For example, to change the way arrays are converted to query strings using the <code>qs</code> module pass the <code>arrayFormat</code> option with one of <code>indices|brackets|repeat</code></li>
  <li><code>useQuerystring</code> - if true, use <code>querystring</code> to stringify and parse
  querystrings, otherwise use <code>qs</code> (default: <code>false</code>). Set this option to
  <code>true</code> if you need arrays to be serialized as <code>foo=bar&amp;foo=baz</code> instead of the
  default <code>foo[0]=bar&amp;foo[1]=baz</code>.</li>
  </ul><hr /><ul><li><code>body</code> - entity body for PATCH, POST and PUT requests. Must be a <code>Buffer</code>, <code>String</code> or <code>ReadStream</code>. If <code>json</code> is <code>true</code>, then <code>body</code> must be a JSON-serializable object.</li>
  <li><code>form</code> - when passed an object or a querystring, this sets <code>body</code> to a querystring representation of value, and adds <code>Content-type: application/x-www-form-urlencoded</code> header. When passed no options, a <code>FormData</code> instance is returned (and is piped to request). See "Forms" section above.</li>
  <li><code>formData</code> - data to pass for a <code>multipart/form-data</code> request. See
  <a href="https://github.com/request/request#forms">Forms</a> section above.</li>
  <li><code>multipart</code> - array of objects which contain their own headers and <code>body</code>
  attributes. Sends a <code>multipart/related</code> request. See <a href="https://github.com/request/request#forms">Forms</a> section
  above.
  <ul><li>Alternatively you can pass in an object <code>{chunked: false, data: []}</code> where
  <code>chunked</code> is used to specify whether the request is sent in
  <a href="https://en.wikipedia.org/wiki/Chunked_transfer_encoding">chunked transfer encoding</a>
  In non-chunked requests, data items with body streams are not allowed.</li>
  </ul></li>
  <li><code>preambleCRLF</code> - append a newline/CRLF before the boundary of your <code>multipart/form-data</code> request.</li>
  <li><code>postambleCRLF</code> - append a newline/CRLF at the end of the boundary of your <code>multipart/form-data</code> request.</li>
  <li><code>json</code> - sets <code>body</code> to JSON representation of value and adds <code>Content-type: application/json</code> header. Additionally, parses the response body as JSON.</li>
  <li><code>jsonReviver</code> - a <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse">reviver function</a> that will be passed to <code>JSON.parse()</code> when parsing a JSON response body.</li>
  <li><code>jsonReplacer</code> - a <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify">replacer function</a> that will be passed to <code>JSON.stringify()</code> when stringifying a JSON request body.</li>
  </ul><hr /><ul><li><code>auth</code> - a hash containing values <code>user</code> || <code>username</code>, <code>pass</code> || <code>password</code>, and <code>sendImmediately</code> (optional). See documentation above.</li>
  <li><code>oauth</code> - options for OAuth HMAC-SHA1 signing. See documentation above.</li>
  <li><code>hawk</code> - options for <a href="https://github.com/hueniverse/hawk">Hawk signing</a>. The <code>credentials</code> key must contain the necessary signing info, <a href="https://github.com/hueniverse/hawk#usage-example">see hawk docs for details</a>.</li>
  <li><code>aws</code> - <code>object</code> containing AWS signing information. Should have the properties <code>key</code>, <code>secret</code>, and optionally <code>session</code> (note that this only works for services that require session as part of the canonical string). Also requires the property <code>bucket</code>, unless you’re specifying your <code>bucket</code> as part of the path, or the request doesn’t use a bucket (i.e. GET Services). If you want to use AWS sign version 4 use the parameter <code>sign_version</code> with value <code>4</code> otherwise the default is version 2. <strong>Note:</strong> you need to <code>npm install aws4</code> first.</li>
  <li><code>httpSignature</code> - options for the <a href="https://github.com/joyent/node-http-signature/blob/master/http_signing.md">HTTP Signature Scheme</a> using <a href="https://github.com/joyent/node-http-signature">Joyent's library</a>. The <code>keyId</code> and <code>key</code> properties must be specified. See the docs for other options.</li>
  </ul><hr /><ul><li><code>followRedirect</code> - follow HTTP 3xx responses as redirects (default: <code>true</code>). This property can also be implemented as function which gets <code>response</code> object as a single argument and should return <code>true</code> if redirects should continue or <code>false</code> otherwise.</li>
  <li><code>followAllRedirects</code> - follow non-GET HTTP 3xx responses as redirects (default: <code>false</code>)</li>
  <li><code>followOriginalHttpMethod</code> - by default we redirect to HTTP method GET. you can enable this property to redirect to the original HTTP method (default: <code>false</code>)</li>
  <li><code>maxRedirects</code> - the maximum number of redirects to follow (default: <code>10</code>)</li>
  <li><code>removeRefererHeader</code> - removes the referer header when a redirect happens (default: <code>false</code>). <strong>Note:</strong> if true, referer header set in the initial request is preserved during redirect chain.</li>
  </ul><hr /><ul><li><code>encoding</code> - encoding to be used on <code>setEncoding</code> of response data. If <code>null</code>, the <code>body</code> is returned as a <code>Buffer</code>. Anything else <strong>(including the default value of <code>undefined</code>)</strong> will be passed as the <a href="http://nodejs.org/api/buffer.html#buffer_buffer">encoding</a> parameter to <code>toString()</code> (meaning this is effectively <code>utf8</code> by default). (<strong>Note:</strong> if you expect binary data, you should set <code>encoding: null</code>.)</li>
  <li><code>gzip</code> - if <code>true</code>, add an <code>Accept-Encoding</code> header to request compressed content encodings from the server (if not already present) and decode supported content encodings in the response. <strong>Note:</strong> Automatic decoding of the response content is performed on the body data returned through <code>request</code> (both through the <code>request</code> stream and passed to the callback function) but is not performed on the <code>response</code> stream (available from the <code>response</code> event) which is the unmodified <code>http.IncomingMessage</code> object which may contain compressed data. See example below.</li>
  <li><code>jar</code> - if <code>true</code>, remember cookies for future use (or define your custom cookie jar; see examples section)</li>
  </ul><hr /><ul><li><code>agent</code> - <code>http(s).Agent</code> instance to use</li>
  <li><code>agentClass</code> - alternatively specify your agent's class name</li>
  <li><code>agentOptions</code> - and pass its options. <strong>Note:</strong> for HTTPS see <a href="http://nodejs.org/api/tls.html#tls_tls_connect_options_callback">tls API doc for TLS/SSL options</a> and the <a href="https://github.com/request/request#using-optionsagentoptions">documentation above</a>.</li>
  <li><code>forever</code> - set to <code>true</code> to use the <a href="https://github.com/request/forever-agent">forever-agent</a> <strong>Note:</strong> Defaults to <code>http(s).Agent({keepAlive:true})</code> in node 0.12+</li>
  <li><code>pool</code> - an object describing which agents to use for the request. If this option is omitted the request will use the global agent (as long as your options allow for it). Otherwise, request will search the pool for your custom agent. If no custom agent is found, a new agent will be created and added to the pool. <strong>Note:</strong> <code>pool</code> is used only when the <code>agent</code> option is not specified.
  <ul><li>A <code>maxSockets</code> property can also be provided on the <code>pool</code> object to set the max number of sockets for all agents created (ex: <code>pool: {maxSockets: Infinity}</code>).</li>
  <li>Note that if you are sending multiple requests in a loop and creating
  multiple new <code>pool</code> objects, <code>maxSockets</code> will not work as intended. To
  work around this, either use <a href="https://github.com/request/request#requestdefaultsoptions"><code>request.defaults</code></a>
  with your pool options or create the pool object with the <code>maxSockets</code>
  property outside of the loop.</li>
  </ul></li>
  <li><code>timeout</code> - integer containing the number of milliseconds to wait for a
  server to send response headers (and start the response body) before aborting
  the request. Note that if the underlying TCP connection cannot be established,
  the OS-wide TCP connection timeout will overrule the <code>timeout</code> option (<a href="http://www.sekuda.com/overriding_the_default_linux_kernel_20_second_tcp_socket_connect_timeout">the
  default in Linux can be anywhere from 20-120 seconds</a>).</li>
  </ul><hr /><ul><li><code>localAddress</code> - local interface to bind for network connections.</li>
  <li><code>proxy</code> - an HTTP proxy to be used. Supports proxy Auth with Basic Auth, identical to support for the <code>url</code> parameter (by embedding the auth info in the <code>uri</code>)</li>
  <li><code>strictSSL</code> - if <code>true</code>, requires SSL certificates be valid. <strong>Note:</strong> to use your own certificate authority, you need to specify an agent that was created with that CA as an option.</li>
  <li><code>tunnel</code> - controls the behavior of
  <a href="https://en.wikipedia.org/wiki/HTTP_tunnel#HTTP_CONNECT_tunneling">HTTP <code>CONNECT</code> tunneling</a>
  as follows:
  <ul><li><code>undefined</code> (default) - <code>true</code> if the destination is <code>https</code>, <code>false</code> otherwise</li>
  <li><code>true</code> - always tunnel to the destination by making a <code>CONNECT</code> request to
  the proxy</li>
  <li><code>false</code> - request the destination as a <code>GET</code> request.</li>
  </ul></li>
  <li><code>proxyHeaderWhiteList</code> - a whitelist of headers to send to a
  tunneling proxy.</li>
  <li><code>proxyHeaderExclusiveList</code> - a whitelist of headers to send
  exclusively to a tunneling proxy and not to destination.</li>
  </ul><hr /><ul><li>
  <p><code>time</code> - if <code>true</code>, the request-response cycle (including all redirects) is timed at millisecond resolution. When set, the following properties are added to the response object:</p>
  <ul><li><code>elapsedTime</code> Duration of the entire request/response in milliseconds (<em>deprecated</em>).</li>
  <li><code>responseStartTime</code> Timestamp when the response began (in Unix Epoch milliseconds) (<em>deprecated</em>).</li>
  <li><code>timingStart</code> Timestamp of the start of the request (in Unix Epoch milliseconds).</li>
  <li><code>timings</code> Contains event timestamps in millisecond resolution relative to <code>timingStart</code>. If there were redirects, the properties reflect the timings of the final request in the redirect chain:
  <ul><li><code>socket</code> Relative timestamp when the <a href="https://nodejs.org/api/http.html#http_event_socket"><code>http</code></a> module's <code>socket</code> event fires. This happens when the socket is assigned to the request.</li>
  <li><code>lookup</code> Relative timestamp when the <a href="https://nodejs.org/api/net.html#net_event_lookup"><code>net</code></a> module's <code>lookup</code> event fires. This happens when the DNS has been resolved.</li>
  <li><code>connect</code>: Relative timestamp when the <a href="https://nodejs.org/api/net.html#net_event_connect"><code>net</code></a> module's <code>connect</code> event fires. This happens when the server acknowledges the TCP connection.</li>
  <li><code>response</code>: Relative timestamp when the <a href="https://nodejs.org/api/http.html#http_event_response"><code>http</code></a> module's <code>response</code> event fires. This happens when the first bytes are received from the server.</li>
  <li><code>end</code>: Relative timestamp when the last bytes of the response are received.</li>
  </ul></li>
  <li><code>timingPhases</code> Contains the durations of each request phase. If there were redirects, the properties reflect the timings of the final request in the redirect chain:
  <ul><li><code>wait</code>: Duration of socket initialization (<code>timings.socket</code>)</li>
  <li><code>dns</code>: Duration of DNS lookup (<code>timings.lookup</code> - <code>timings.socket</code>)</li>
  <li><code>tcp</code>: Duration of TCP connection (<code>timings.connect</code> - <code>timings.socket</code>)</li>
  <li><code>firstByte</code>: Duration of HTTP server response (<code>timings.response</code> - <code>timings.connect</code>)</li>
  <li><code>download</code>: Duration of HTTP download (<code>timings.end</code> - <code>timings.response</code>)</li>
  <li><code>total</code>: Duration entire HTTP round-trip (<code>timings.end</code>)</li>
  </ul></li>
  </ul></li>
  <li>
  <p><code>har</code> - a <a href="http://www.softwareishard.com/blog/har-12-spec/#request">HAR 1.2 Request Object</a>, will be processed from HAR format into options overwriting matching values <em>(see the <a href="https://github.com/request/request#support-for-har-1.2">HAR 1.2 section</a> for details)</em></p>
  </li>
  <li>
  <p><code>callback</code> - alternatively pass the request's callback in the options object</p>
  </li>
  </ul><p>The callback argument gets 3 arguments:</p>
  <ol><li>An <code>error</code> when applicable (usually from <a href="http://nodejs.org/api/http.html#http_class_http_clientrequest"><code>http.ClientRequest</code></a> object)</li>
  <li>An <a href="https://nodejs.org/api/http.html#http_class_http_incomingmessage"><code>http.IncomingMessage</code></a> object (Response object)</li>
  <li>The third is the <code>response</code> body (<code>String</code> or <code>Buffer</code>, or JSON object if the <code>json</code> option is supplied)</li>
  </ol><p><a href="https://github.com/request/request#table-of-contents">back to top</a></p>
  <hr /><h2><a id="user-content-convenience-methods" class="anchor" href="https://github.com/request/request#convenience-methods"></a>Convenience methods</h2>
  <p>There are also shorthand methods for different HTTP METHODs and some other conveniences.</p>
  <h3><a id="user-content-requestdefaultsoptions" class="anchor" href="https://github.com/request/request#requestdefaultsoptions"></a>request.defaults(options)</h3>
  <p>This method <strong>returns a wrapper</strong> around the normal request API that defaults
  to whatever options you pass to it.</p>
  <p><strong>Note:</strong> <code>request.defaults()</code> <strong>does not</strong> modify the global request API;
  instead, it <strong>returns a wrapper</strong> that has your default settings applied to it.</p>
  <p><strong>Note:</strong> You can call <code>.defaults()</code> on the wrapper that is returned from
  <code>request.defaults</code> to add/override defaults that were previously defaulted.</p>
  <p>For example:</p>
  <div class="highlight highlight-source-js"><pre>//requests using baseRequest() will set the 'x-token' header
  var baseRequest = request.defaults({
    headers: {'x-token': 'my-token'}
  })
  //requests using specialRequest() will include the 'x-token' header set in
  //baseRequest and will also include the 'special' header
  var specialRequest = baseRequest.defaults({
    headers: {special: 'special value'}
  })</pre></div>
  <h3><a id="user-content-requestmethod" class="anchor" href="https://github.com/request/request#requestmethod"></a>request.METHOD()</h3>
  <p>These HTTP method convenience functions act just like <code>request()</code> but with a default method already set for you:</p>
  <ul><li><em>request.get()</em>: Defaults to <code>method: "GET"</code>.</li>
  <li><em>request.post()</em>: Defaults to <code>method: "POST"</code>.</li>
  <li><em>request.put()</em>: Defaults to <code>method: "PUT"</code>.</li>
  <li><em>request.patch()</em>: Defaults to <code>method: "PATCH"</code>.</li>
  <li><em>request.del() / request.delete()</em>: Defaults to <code>method: "DELETE"</code>.</li>
  <li><em>request.head()</em>: Defaults to <code>method: "HEAD"</code>.</li>
  <li><em>request.options()</em>: Defaults to <code>method: "OPTIONS"</code>.</li>
  </ul><h3><a id="user-content-requestcookie" class="anchor" href="https://github.com/request/request#requestcookie"></a>request.cookie()</h3>
  <p>Function that creates a new cookie.</p>
  <div class="highlight highlight-source-js"><pre>request.cookie('key1=value1')</pre></div>
  <h3><a id="user-content-requestjar" class="anchor" href="https://github.com/request/request#requestjar"></a>request.jar()</h3>
  <p>Function that creates a new cookie jar.</p>
  <div class="highlight highlight-source-js"><pre>request.jar()</pre></div>
  <p><a href="https://github.com/request/request#table-of-contents">back to top</a></p>
  <hr /><h2><a id="user-content-debugging" class="anchor" href="https://github.com/request/request#debugging"></a>Debugging</h2>
  <p>There are at least three ways to debug the operation of <code>request</code>:</p>
  <ol><li>
  <p>Launch the node process like <code>NODE_DEBUG=request node script.js</code>
  (<code>lib,request,otherlib</code> works too).</p>
  </li>
  <li>
  <p>Set <code>require('request').debug = true</code> at any time (this does the same thing
  as #1).</p>
  </li>
  <li>
  <p>Use the <a href="https://github.com/request/request-debug">request-debug module</a> to
  view request and response headers and bodies.</p>
  </li>
  </ol><p><a href="https://github.com/request/request#table-of-contents">back to top</a></p>
  <hr /><h2><a id="user-content-timeouts" class="anchor" href="https://github.com/request/request#timeouts"></a>Timeouts</h2>
  <p>Most requests to external servers should have a timeout attached, in case the
  server is not responding in a timely manner. Without a timeout, your code may
  have a socket open/consume resources for minutes or more.</p>
  <p>There are two main types of timeouts: <strong>connection timeouts</strong> and <strong>read
  timeouts</strong>. A connect timeout occurs if the timeout is hit while your client is
  attempting to establish a connection to a remote machine (corresponding to the
  <a href="http://linux.die.net/man/2/connect">connect() call</a> on the socket). A read timeout occurs any time the
  server is too slow to send back a part of the response.</p>
  <p>These two situations have widely different implications for what went wrong
  with the request, so it's useful to be able to distinguish them. You can detect
  timeout errors by checking <code>err.code</code> for an 'ETIMEDOUT' value. Further, you
  can detect whether the timeout was a connection timeout by checking if the
  <code>err.connect</code> property is set to <code>true</code>.</p>
  <div class="highlight highlight-source-js"><pre>request.get('http://10.255.255.1', {timeout: 1500}, function(err) {
      console.log(err.code === 'ETIMEDOUT');
      // Set to `true` if the timeout was a connection timeout, `false` or
      // `undefined` otherwise.
      console.log(err.connect === true);
      process.exit(0);
  });</pre></div>
  <h2><a id="user-content-examples" class="anchor" href="https://github.com/request/request#examples"></a>Examples:</h2>
  <div class="highlight highlight-source-js"><pre>  var request = require('request')
      , rand = Math.floor(Math.random()*100000000).toString()
      ;
    request(
      { method: 'PUT'
      , uri: 'http://mikeal.iriscouch.com/testjs/' + rand
      , multipart:
        [ { 'content-type': 'application/json'
          ,  body: JSON.stringify({foo: 'bar', _attachments: {'message.txt': {follows: true, length: 18, 'content_type': 'text/plain' }}})
          }
        , { body: 'I am an attachment' }
        ]
      }
    , function (error, response, body) {
        if(response.statusCode == 201){
          console.log('document saved as: http://mikeal.iriscouch.com/testjs/'+ rand)
        } else {
          console.log('error: '+ response.statusCode)
          console.log(body)
        }
      }
    )</pre></div>
  <p>For backwards-compatibility, response compression is not supported by default.
  To accept gzip-compressed responses, set the <code>gzip</code> option to <code>true</code>. Note
  that the body data passed through <code>request</code> is automatically decompressed
  while the response object is unmodified and will contain compressed data if
  the server sent a compressed response.</p>
  <div class="highlight highlight-source-js"><pre>  var request = require('request')
    request(
      { method: 'GET'
      , uri: 'http://www.google.com'
      , gzip: true
      }
    , function (error, response, body) {
        // body is the decompressed response body
        console.log('server encoded the data as: ' + (response.headers['content-encoding'] || 'identity'))
        console.log('the decoded data is: ' + body)
      }
    )
    .on('data', function(data) {
      // decompressed data as it is received
      console.log('decoded chunk: ' + data)
    })
    .on('response', function(response) {
      // unmodified http.IncomingMessage object
      response.on('data', function(data) {
        // compressed data as it is received
        console.log('received ' + data.length + ' bytes of compressed data')
      })
    })</pre></div>
  <p>Cookies are disabled by default (else, they would be used in subsequent requests). To enable cookies, set <code>jar</code> to <code>true</code> (either in <code>defaults</code> or <code>options</code>).</p>
  <div class="highlight highlight-source-js"><pre>var request = request.defaults({jar: true})
  request('http://www.google.com', function () {
    request('http://images.google.com')
  })</pre></div>
  <p>To use a custom cookie jar (instead of <code>request</code>’s global cookie jar), set <code>jar</code> to an instance of <code>request.jar()</code> (either in <code>defaults</code> or <code>options</code>)</p>
  <div class="highlight highlight-source-js"><pre>var j = request.jar()
  var request = request.defaults({jar:j})
  request('http://www.google.com', function () {
    request('http://images.google.com')
  })</pre></div>
  <p>OR</p>
  <div class="highlight highlight-source-js"><pre>var j = request.jar();
  var cookie = request.cookie('key1=value1');
  var url = 'http://www.google.com';
  j.setCookie(cookie, url);
  request({url: url, jar: j}, function () {
    request('http://images.google.com')
  })</pre></div>
  <p>To use a custom cookie store (such as a
  <a href="https://github.com/mitsuru/tough-cookie-filestore"><code>FileCookieStore</code></a>
  which supports saving to and restoring from JSON files), pass it as a parameter
  to <code>request.jar()</code>:</p>
  <div class="highlight highlight-source-js"><pre>var FileCookieStore = require('tough-cookie-filestore');
  // NOTE - currently the 'cookies.json' file must already exist!
  var j = request.jar(new FileCookieStore('cookies.json'));
  request = request.defaults({ jar : j })
  request('http://www.google.com', function() {
    request('http://images.google.com')
  })</pre></div>
  <p>The cookie store must be a
  <a href="https://github.com/SalesforceEng/tough-cookie"><code>tough-cookie</code></a>
  store and it must support synchronous operations; see the
  <a href="https://github.com/SalesforceEng/tough-cookie#cookiestore-api"><code>CookieStore</code> API docs</a>
  for details.</p>
  <p>To inspect your cookie jar after a request:</p>
  <div class="highlight highlight-source-js"><pre>var j = request.jar()
  request({url: 'http://www.google.com', jar: j}, function () {
    var cookie_string = j.getCookieString(url); // "key1=value1; key2=value2; ..."
    var cookies = j.getCookies(url);
    // [{key: 'key1', value: 'value1', domain: "www.google.com", ...}, ...]
  })</pre></div>
  <p><a href="https://github.com/request/request#table-of-contents">back to top</a></p>


title: Netsh
url: https://www.netsh.be/
created_at: 2017-08-10 23:18:49
updated_at: 2017-08-10 23:18:49
mimetype: text/html
language: fr-FR
domain_name: www.netsh.be
http_status: 200
content:
  <div class="entry-content">
  						<p>Bonjour à tous,<br />
  Comme vous avez pu le remarquer, j’ai laissé le blog un peu de coter cette dernière année (durant laquelle, j’ai été très occupé)<br />
  C’est pourquoi j’ai décidé de reprendre celui-ci et d’y consacrer un peu plus de temps.</p>
  <p><a class="btn btn-default btn-sm" href="https://www.netsh.be/reprise-des-articles/">Lire la suite de <i class="fa fa-angle-double-right"></i></a></p>
  								</div><div class="entry-content">
  						<p>Cette après-midi, en surfant sur Adsl-bc, je suis tombé sur une capture d’écran qui laisse penser que Proximus viole la neutralité du net.</p>
  <p><strong>Edit du 8/6/2016 – Proximus répond en commentaires :</strong></p>
  <p><a class="btn btn-default btn-sm" href="https://www.netsh.be/proximus-viole-t-il-la-neutralite-du-net/">Lire la suite de <i class="fa fa-angle-double-right"></i></a></p>
  								</div><div class="entry-content">
  						<p><a href="https://www.netsh.be/wp-content/uploads/2015/04/modem-front.jpg"><img class="alignnone size-full wp-image-185" src="https://www.netsh.be/wp-content/uploads/2015/04/modem-front.jpg" alt="modem-front" width="4208" height="1648" /></a></p>
  <p>Bonjour,</p>
  <p><strong>Je tiens tout d’abord à préciser que je réalise ce test de mon plein gré et que le test porte sur une solution qui n’est pas encore finalisée. Je n’ai donc aucun rapport avec la société Mobistar (orange be)</strong></p>
  <p>Mobistar met à ma disposition pour un délai de 6 mois son offre Internet + TV afin d’améliorer son produit sans aucune contrepartie.</p>
  <p><a class="btn btn-default btn-sm" href="https://www.netsh.be/test-de-la-solution-internet-tv-mobistar-via-le-cable-update-nouveau-decodeur-prix-connus/">Lire la suite de <i class="fa fa-angle-double-right"></i></a></p>
  								</div><div class="entry-content">
  						<p><a href="https://www.netsh.be/wp-content/uploads/2016/01/print.jpg" rel="attachment wp-att-442"><img class="alignnone size-full wp-image-442" src="https://www.netsh.be/wp-content/uploads/2016/01/print.jpg" alt="print" width="971" height="441" /></a></p>
  <p>Récemment, j’en ai eu marre des gens qui activent systématiquement un accusé de réception dans leurs e-mails.</p>
  <p>De plus, il n’est pas possible de les désactiver dans le client mail d’android (one plus one sur cyanogen).</p>
  <p><a class="btn btn-default btn-sm" href="https://www.netsh.be/supprimer-les-accuse-de-reception-automatiquement-avec-postfix/">Lire la suite de <i class="fa fa-angle-double-right"></i></a></p>
  								</div><div class="entry-content">
  						<div class="mceTemp">
  <p>Bien d’entre vous ont déjà entendu parler du projet <a href="https://letsencrypt.org" target="_blank" rel="noopener noreferrer">Let’s Encrypt</a> ayant pour unique but de favoriser la cryptographie de bout en bout (HTTPS) sur la majorité des sites internet. Sauf que pour mettre en place Let’s Encrypt sur un site quelconque il faut qu’il accepte les fichiers temporaires dans un répertoire ou d’utiliser une redirection ou de développer un bout de code à côté mais ces méthodes ne sont pas toujours très favorables lorsqu’on possède de multiples domaines sous différentes technologies ou bien qu’on n’a pas nécessairement envie de toucher à sa configuration actuelle qui marche du tonnerre.</p>
  <p><a class="btn btn-default btn-sm" href="https://www.netsh.be/obtenir-certificat-ssl-gratuitement-letsencrypt-sans-toucher-serveur-web/">Lire la suite de <i class="fa fa-angle-double-right"></i></a></p>
  								</div><div class="entry-content">
  						<p><a href="https://www.netsh.be/wp-content/uploads/2015/10/print.png"><img class="alignnone size-full wp-image-395" src="https://www.netsh.be/wp-content/uploads/2015/10/print.png" alt="print" width="950" height="310" /></a></p>
  <p>Proxmox 4 est sorti et j’en ai profité pour réinstaller proprement mon serveur de virtualisation.</p>
  <p>Seulement voilà, proxmox ne gère pas le raid logiciel nativement. Voici comment faire !</p>
  <p><a class="btn btn-default btn-sm" href="https://www.netsh.be/raid-logiciel-md-raid-sous-proxmox-4/">Lire la suite de <i class="fa fa-angle-double-right"></i></a></p>
  								</div><div class="entry-content">
  						<p>Cet article n’est pas un article qui explique comment mettre en place un serveur mail de A à Z, mais plutôt un article qui vous explique les trucs et astuces à faire pour être bien considéré, notamment par les serveurs mails type Outlook (anciennement Hotmail) ou Gmail. On parle aussi dans le jargon de réputation email ou d’e-réputation mail.</p>
  <p>Mes exemples de configurations sont basés sur Debian 7 et Postfix. Ils sont aisément adaptables à toute autre configuration.</p>
  <p>Je pars du principe que vous êtes déjà en mesure d’envoyer et de recevoir des e-mails depuis votre serveur.</p>
  <p><a class="btn btn-default btn-sm" href="https://www.netsh.be/bien-configurer-son-serveur-mail-comment-bien-se-faire-voir-par-le-reseau/">Lire la suite de <i class="fa fa-angle-double-right"></i></a></p>
  								</div><div class="entry-content">
  						<p><a href="https://www.netsh.be/wp-content/uploads/2015/06/bugie.png"><img class="alignnone size-full wp-image-273" src="https://www.netsh.be/wp-content/uploads/2015/06/bugie.png" alt="bugie" width="877" height="142" /></a></p>
  <p>Cette après-midi, j’ai pu découvrir un nouveau bug étrange dans Internet Explorer (oui, encore lui). J’ai pu remarquer qu’une requête POST via XMLHttpRequest échouait systématiquement (serveur Apache 2.2 et 2.4) avec le message suivant quand le serveur utilisait un certificat SSL:</p>
  <p>XMLHttpRequest: Erreur réseau 0x2ef3, Impossible d’effectuer l’opération à cause de l’erreur suivante 00002ef3.</p>
  <p><a class="btn btn-default btn-sm" href="https://www.netsh.be/erreur-0x2ef3-sous-internet-explorer-lors-dun-post-via-xmlhttprequest/">Lire la suite de <i class="fa fa-angle-double-right"></i></a></p>
  								</div><div class="entry-content">
  						<p>Après être passé en Debian 8, mon serveur Apache ne fonctionnait plus correctement. La raison de ce problème est lié au fait que, par cette nouvelle version de Debian, Apache passe de la version 2.2 à 2.4. Voici un article pour vous présenter les changements de configuration que j’ai dû opérer.</p>
  <p><a class="btn btn-default btn-sm" href="https://www.netsh.be/apache-ne-fonctionne-plus-apres-mon-passage-sous-debian-8/">Lire la suite de <i class="fa fa-angle-double-right"></i></a></p>
  								</div><div class="entry-content">
  						<p><a href="https://www.netsh.be/wp-content/uploads/2015/05/apcresuldt.png"><img class="alignnone size-full wp-image-251" src="https://www.netsh.be/wp-content/uploads/2015/05/apcresuldt.png" alt="apcresuldt" width="769" height="422" /></a></p>
  <p>J’ai récemment dû changer les batteries de mon onduleur. Bien évidemment, après changement, Apcupsd ne voyait pas la bonne autonomie. Voici comment recalibrer vos onduleurs APC via Apcupsd.</p>
  <p>Après avoir changé le pack de batterie de l’onduleur, connectez-vous sur la machine ou est connecté votre onduleur.</p>
  <p>Les commandes correspondent à une Debian, mais il est très facile de les transposer pour votre distribution.</p>
  <p><a class="btn btn-default btn-sm" href="https://www.netsh.be/calibrer-un-onduleur-apc-via-apcupsd/">Lire la suite de <i class="fa fa-angle-double-right"></i></a></p>
  								</div></div>


title: The anatomy of responsive images
url: https://jakearchibald.com/2015/anatomy-of-responsive-images/
created_at: 2017-08-10 23:19:03
updated_at: 2017-08-10 23:19:03
mimetype: text/html
domain_name: jakearchibald.com
preview_picture: https://jakearchibald.com/static/imgs/icon.e36785a43208.png
http_status: 200
content:
      Posted 03 September 2015
      
    <p>I just had my responsive images epiphany and I'm writing it all down before I forget everything. This is what I know…</p>
  <h2 id="fixed-size-varying-density">Fixed size, varying density</h2>
  <p>If your image is a fixed size in pixels, but you want to cater for screens of different density, here's the solution:</p>
  <p>
    &lt;imgalt="A cat"width="320"height="213"src="cat.jpg"srcset="cat-2x.jpg 2x, cat-3x.jpg 3x"&gt;Fixed size, here or in CSSThis is used as the 1x src &amp; by browsers that don’t support srcsetImage urlPixel density of screen</p>
  <p>This <a href="http://caniuse.com/#search=srcset">works in all modern browsers</a>, and falls back to <code>src</code> in older browsers.</p>
  <p>A few more rules, not covered in the image above:</p>
  <ul><li>Each item within <code>srcset</code> is <code>&lt;url&gt; &lt;density&gt;x</code>, eg <code>cat-2x.jpg 2x</code></li>
  <li>The order of items within the <code>srcset</code> doesn't matter</li>
  <li>If you don't specify width/height, the browser will display the image at its native width/height divided by the density. Eg if the 2x resource is picked, it'll be rendered at 50% of the resources width/height</li>
  <li>This is only a hint, even on a 3x device the browser may use the 1x image, perhaps due to poor connectivity</li>
  </ul><h3 id="live-example">Live example</h3>
  <img alt="A cat" width="320" height="213" src="https://jakearchibald.com/static/posts/responsive-images/cat-1x.b3b4dfd8b1a9.jpg" /><h2 id="varying-size-and-density">Varying size and density</h2>
  <p>Images of varying width are commonly used as part of the content on responsive sites. On this blog, content imagery takes up 100% of the article width, but the article isn't always 100% of the window.</p>
  <p>In order for the browser to pick the right image, it needs to know:</p>
  <ul><li>URLs for the image at various sizes</li>
  <li>The decoded width of each of those image resources</li>
  <li>The width of the <code>&lt;img&gt;</code></li>
  </ul><p>That last one is particularly tricky, as images start downloading before CSS is ready, so the width of the <code>&lt;img&gt;</code> cannot be detected from the page layout.</p>
  <p>The key to understanding this syntax is knowing which of these values refer to the window width, the decoded image width, and the <code>&lt;img&gt;</code> width.</p>

    &lt;imgalt="A red panda eating leaves"src="panda-689.jpg"srcset="panda-689.jpg 689w,             panda-1378.jpg 1378w,             panda-500.jpg 500w,             panda-1000.jpg 1000w"sizes="(min-width: 1066px) 689px,            (min-width: 800px) calc(75vw - 137px),            (min-width: 530px) calc(100vw - 96px),            100vw"&gt;Only for browsers that don’t support srcsetImage urlWidth of the image dataWidth of the windowWidth of the img elementwhen the condition matchesFallback width, when no media conditions match<p>Via <code>srcset</code>, the browser knows the resources available and their widths. Via <code>sizes</code> it knows the width of the <code>&lt;img&gt;</code> for a given window width. It can now pick the best resource to load.</p>
  <p>You don't need to specify density, the browser figure that out itself. If the window is <code>1066px</code> wide or greater, we've signalled that the <code>&lt;img&gt;</code> will be <code>689px</code> wide. On a 1x device the browser may download <code>panda-689.jpg</code>, but on a 2x device the browser may download <code>panda-1378.jpg</code>.</p>
  <p>A few more rules, not covered in the image above:</p>
  <ul><li>Each item within <code>srcset</code> is <code>&lt;url&gt; &lt;width-descriptor&gt;w</code>, eg <code>panda-689.jpg 689w</code></li>
  <li>The order of items within the <code>srcset</code> doesn't matter</li>
  <li>If <code>srcset</code> contains a width descriptor, the <code>src</code> is ignored by browsers that support <code>srcset</code></li>
  <li>Each item within <code>sizes</code> is <code>&lt;media-condition&gt; &lt;image-element-width&gt;</code>, except for the last entry which is just <code>&lt;image-element-width&gt;</code></li>
  <li>Both of the widths in <code>sizes</code> are in CSS pixels</li>
  <li>The browser uses the <em>first</em> media condition match in <code>sizes</code>, so the order matters</li>
  <li>As before, the browser may download a lower resolution image due to other factors such as poor connectivity</li>
  </ul><p>Picking which <code>sizes</code> to list is pretty straight forward. Start with your window at its narrowest, and as you increase its size, create a new rule whenever the <code>&lt;img&gt;</code> size vs window size changes formula. </p>
  <p>When this window is at its narrowest, the <code>&lt;img&gt;</code> is full width, or <code>100vw</code>. When the window goes beyond <code>530px</code> the content area on this page gets <code>32px</code> padding on the left and <code>64px</code> on the right, so the <code>&lt;img&gt;</code> is now <code>calc(100vw - 96px)</code>.</p>
  <p>The browser won't call the police if it finds out you lied about the <code>&lt;img&gt;</code> width. I've been accurate with my <code>sizes</code>, but a rough answer can be good enough, eg <code>sizes="(min-width: 1066px) 689px, (min-width: 800px) 75vw, 100vw"</code>. </p>
  <p>Picking which resources to create and include in <code>srcset</code> is much harder, and I don't think I've mastered it. In the above example I include the maximum size the <code>&lt;img&gt;</code> can be (<code>689px</code>) and double that for 2x devices (<code>1378px</code>). The other two are rough in-between values. I didn't include smaller widths such as <code>320px</code>, under the assumption that screens of that size will be 2x density or greater.</p>
  <p><code>srcset</code> + <code>sizes</code> <a href="http://caniuse.com/#search=srcset">works in Chrome, Firefox, and Opera</a>. For other browsers, it'll safely fall back to <code>src</code>. You don't have to wait long for better support here, it's in WebKit nightly &amp; will appear in the next stable version of Edge.</p>
  <h3 id="live-example_1">Live example</h3>
  <img alt="A red panda eating leaves" src="https://jakearchibald.com/static/posts/responsive-images/panda-689.6adaf8a7c694.jpg" /><h2 id="varying-width-density-and-art-direction">Varying width, density, and art direction</h2>
  <p>Similar to the previous example, but the framing changes at different widths. This allows you to focus in on the subject at smaller widths.</p>

    &lt;picture&gt;  &lt;sourcemedia="(max-width: 800px)"srcset="f1-focused-800.jpg 800w,                  f1-focused-1406.jpg 1406w"sizes="(min-width: 530px) calc(100vw - 96px),                 100vw"&gt;  &lt;imgalt="F1 car in the gravel"src="f1-689.jpg"srcset="f1-689.jpg 689w,               f1-1378.jpg 1378w,               f1-500.jpg 500w,               f1-1000.jpg 1000w"sizes="(min-width: 1066px) 689px,              calc(75vw - 137px)"&gt;&lt;/picture&gt;If this query matches the window, use these to select the src…else use these<ul><li>You can have as many <code>&lt;source&gt;</code>s as you want</li>
  <li>You <em>must</em> include an <code>&lt;img&gt;</code></li>
  <li>The media query on <code>&lt;source&gt;</code> will always be obeyed, it's not just a hint</li>
  <li>The media query is based on the window's width, not the <code>&lt;img&gt;</code></li>
  <li>The first matching <code>&lt;source&gt;</code> will be used, so the order matters</li>
  <li>If no matching <code>&lt;source&gt;</code> is found, the <code>&lt;img&gt;</code> is used</li>
  <li>The <code>&lt;img&gt;</code> must appear after all <code>&lt;source&gt;</code>s</li>
  <li><code>&lt;source&gt;</code> doesn't support <code>src</code>, but <code>srcset="whatever.jpg"</code> works just as well</li>
  </ul><p>Once the <code>&lt;source&gt;</code> or <code>&lt;img&gt;</code> is selected, the <code>srcset</code> and <code>sizes</code> attributes work as in previous examples, so you can mix and match techniques.</p>
  <p>The <code>&lt;picture&gt;</code> element <a href="http://caniuse.com/#search=picture">works in Chrome, Firefox, and Opera</a>, and falls back to the <code>&lt;img&gt;</code> in other browsers. I'm told it <a href="https://twitter.com/jacobrossi/status/639471869473656832">might make it into the next release of Edge</a>, which is nice.</p>
  <h3 id="live-example_2">Live example</h3>
  <img alt="F1 car in the gravel" src="https://jakearchibald.com/static/posts/responsive-images/f1-689.d6ed1b428a74.jpg" /><h2 id="varying-on-type">Varying on type</h2>
  <p>This method allows you to serve better-optimised formats to browsers that support them.</p>

    &lt;picture&gt;  &lt;sourcetype="image/webp"srcset="snow.webp"&gt;  &lt;imgalt="Hut in the snow"src="snow.jpg"&gt;&lt;/picture&gt;If this type is supported, use this…else this<ul><li><code>type</code> is a mime type</li>
  <li>You can have multiple sources and mix <code>type</code> with <code>media</code>, <code>srcset</code>, and even <code>sizes</code> to create something truly monstrous/awesome</li>
  </ul><p>This <a href="http://caniuse.com/#search=picture">works in Chrome, Firefox, and Opera</a>, and falls back to the <code>&lt;img&gt;</code> in other browsers.</p>
  <h3 id="live-example_3">Live example</h3>
  <img alt="Hut in the snow" src="https://jakearchibald.com/static/posts/responsive-images/snow.9f5756525434.jpg" /><h2 id="further-reading">Further reading</h2>
  <p>Hopefully the above helps as a kind of quick reference to the various use-cases, but if not, dig into these:</p>
  <ul><li><a href="http://blog.cloudfour.com/responsive-images-101-definitions/">A 10-part novella on responsive images</a> - by Jason Grigsby</li>
  <li><a href="https://dev.opera.com/articles/responsive-images/">Responsive Images: Use Cases and Code Snippets</a> - similar to this article, but covers more combinations of use-cases</li>
  <li><a href="https://developers.google.com/web/updates/2015/09/automating-resource-selection-with-client-hints">Client hints</a> - a server-side alternative to responsive images</li>
  </ul><p><small>Thanks to Mike Hall, Jason Grigsby, Simon Peters, and Yoav Weiss for proofreading and point-sharpening.</small></p>


title: How to use MongoDB & NodeJS with Docker (video included) — ifdattic
url: http://www.ifdattic.com/how-to-mongodb-nodejs-docker/
created_at: 2017-08-10 23:19:04
updated_at: 2017-08-10 23:19:04
mimetype: text/html
domain_name: www.ifdattic.com
http_status: 200
content:
  <div>
              <p>This is the short intro on how to use spin up MongoDB and NodeJS containers using Docker. This will take you step by step on how to run those containers, some problems you might run into, how to avoid some pitfalls. After it you will have enough experience on working with Docker, MongoDB &amp; NodeJS. It will provide enough foundation to use those technologies and will give a head start if you will want to learn more. Initial intent was to use it for MongDB course from MongoDBUniversity, but it was reworked for general use. Part of the tutorial will provide tips on how to use it with the mentioned course.</p>
  <p><del datetime="2015-01-27">A few months ago a friend mentioned a <a href="https://university.mongodb.com/courses/M101JS/about">MongoDB course from MongoDBUniversity</a>, which sounded like a lot of fun so of course I enrolled into it. It started a few days ago and it's a lot of fun. As I like to keep my OS clean the Docker looked like a great solution (one of the reasons I like it, just do something and throw it away after you're done, just like with cloud computing). This way I could take three rabbits with one shot learning <a href="http://www.mongodb.org/">MongoDB</a>, <a href="http://nodejs.org/">Node.js</a> and <a href="https://www.docker.com/">Docker</a> at the same time.</del></p>
  <p><del datetime="2015-01-27">I just noticed that because I had to figure some things to make it all work this can be a great opportunity for an article to help my fellow companions with this step.</del></p>
  <p>Please note that I'm using Mac OS so you might need to adjust examples to your OS and/or user. Please use the <a href="https://docs.docker.com/installation/#installation">installation instructions</a> to launch the docker on your machine.</p>
  <h2 id="mongodb">MongoDB</h2>
  <iframe width="732" height="412" src="https://www.youtube.com/embed/axt6O6myUvs?list=PLOyuTJZcQNNDSVMlAkIEoPX9CDrOGyTVt" frameborder="0" allowfullscreen="allowfullscreen">[embedded content]</iframe>
  <p>First get the latest <a href="https://registry.hub.docker.com/_/mongo/">mongo image</a>:</p>
  <pre class="bash">docker pull mongo:latest
  </pre>
  <p>And when launch your MongoDB container:</p>
  <pre class="bash">docker run -v "$(pwd)":/data --name mongo -d mongo mongod --smallfiles
  </pre>
  <p>The current directory you're running this command from will be used as data directory in your container (provided by <code>$(pwd)</code>). Change it if you need to by entering the full path.</p>
  <p>The running containers can be checked by:</p>
  <pre class="bash"># display only running containers
  docker ps
  # or if you want all containers displayed
  docker ps -a
  </pre>
  <p>There are two options for connecting to your Mongo database.</p>
  <pre class="bash">docker run -it \
      --link mongo:mongo \
      --rm mongo sh \
      -c 'exec mongo "$MONGO_PORT_27017_TCP_ADDR:$MONGO_PORT_27017_TCP_PORT/test"'
  # or on one line for easier copy-paste
  docker run -it --link mongo:mongo --rm mongo sh -c 'exec mongo "$MONGO_PORT_27017_TCP_ADDR:$MONGO_PORT_27017_TCP_PORT/test"'
  </pre>
  <p>This will create a new mongo container which is linked with an existing mongo container. After container is created the command which connects to database is executed.</p>
  <p>Personally, I like just connecting to a running container and executing needed commands from it. You can do what with:</p>
  <pre class="bash">docker exec -it 442c2541fe1a bash # by ID
  # or
  docker exec -it mongo bash # by Name
  </pre>
  <p>To test that your mongo database is working execute the following commands from mongo container:</p>
  <pre class="bash">mongo
  db.col.insert({"a": 4})
  db.col.find().pretty()
  </pre>
  <p>The new document should have been inserted and displayed back to you. You Mongo database is up and ready to be used in your projects.</p>
  <h3 id="dump-and-restore-the-database">Dump and restore the database</h3>
  <iframe width="732" height="412" src="https://www.youtube.com/embed/bZFXxhkrD44?list=PLOyuTJZcQNNDSVMlAkIEoPX9CDrOGyTVt" frameborder="0" allowfullscreen="allowfullscreen">[embedded content]</iframe>
  <p>Please note that depending on your set up the database files might not be synced with your host OS. You can check this by listing the files of database directory:</p>
  <pre class="bash">ls -la db
  </pre>
  <p>If it's empty then database files are not synced.</p>
  <p>If the data you have in your database is important and you don't want to lose it export it before removing your container (stopping the container will preserve the files).</p>
  <p>Please check the documentation or <code>--help</code> output for more information, but to do a simple export run the following from the container (export <code>test</code> database to <code>/data/test-backup</code> destination):</p>
  <pre class="bash">mongodump --db test --out /data/test-backup
  </pre>
  <p>Your data directory (from the container) should now contain the backup files and it should be synced with your host OS.</p>
  <p>To restore the data run the following from container (restore <code>/data/test-backup/test/</code> into a <code>test-restored</code> database):</p>
  <pre class="bash">mongorestore --db test-restored /data/test-backup/test
  </pre>
  <h2 id="node.js">Node.js</h2>
  <iframe width="732" height="412" src="https://www.youtube.com/embed/0frJFB9toFQ?list=PLOyuTJZcQNNDSVMlAkIEoPX9CDrOGyTVt" frameborder="0" allowfullscreen="allowfullscreen">[embedded content]</iframe>
  <p>First get the latest <a href="https://registry.hub.docker.com/_/node/">node image</a>:</p>
  <pre class="bash">docker pull node:latest
  </pre>
  <p>To launch the NodeJS container run:</p>
  <pre class="bash">docker run -it --rm node
  </pre>
  <p>This will run the node container and will put you in the interactive shell (REPL) from which you can execute code. You can test it by entering:</p>
  <pre class="bash">console.log('It works!!')
  </pre>
  <p>To exit the interactive shell and remove the container (as it contains <code>--rm</code> option) press <code>Control+C</code> twice.</p>
  <p>You have multiple ways of running your NodeJS applications. One which I personally like (especially for MongoDB course) is to create a container which has all the required data mounted and is linked to mongo container. This allows to run multiple applications without having to create new containers. It also exposes the port to host machine so you could open the application in your browser. If you want you can set working directory with <code>-w</code> option.</p>
  <pre class="bash">docker run -it --name node -v "$(pwd)":/data --link mongo:mongo -w /data -p 8082:8082 node bash
  </pre>
  <p>Now to run the application just enter its directory, install dependencies and run front controller script:</p>
  <pre class="bash"># execute commands in container
  cd hw3-2and3-3/blog
  npm install
  node app.js
  </pre>
  <p>If you're running these examples with MongoDB course examples it will fail. This is because it's trying to connect to Mongo database on localhost, but our Mongo database isn't on local machine. There are multiple ways to fix this:</p>
  <ul><li>hard code the connection string (with linked container IP);</li>
  <li>use environment variables which are added automatically by Docker (when linking);</li>
  <li>use hosts entry which is added automatically by Docker (when linking).</li>
  </ul><p>Example below contains the representation of all those methods. Please choose the one which you like most or is best for your use case.</p>
  <pre class="javascript">// Original connect
  MongoClient.connect('mongodb://localhost:27017/blog', function(err, db) {
      // ...
  });
  // Connect using environment variables
  MongoClient.connect('mongodb://'+process.env.MONGO_PORT_27017_TCP_ADDR+':'+process.env.MONGO_PORT_27017_TCP_PORT+'/blog', function(err, db) {
      // ...
  });
  // Connect using hosts entry
  MongoClient.connect('mongodb://mongo:27017/blog', function(err, db) {
      // ...
  });
  </pre>
  <p>After fixing the <code>connect()</code> method the application should run successfully. You can reach it by opening <code>http://192.168.59.103:8082</code> (if it was IP address of your Docker application) or if you added the Docker IP as <code>docker</code> in your hosts file <code>http://docker:8082</code>.</p>
  <p>To exit your application press <code>Control-C</code></p>
  <p>It's also possible to run the application in container directly.</p>
  <pre class="bash"># from host OS terminal
  docker run \
      --name nodeapp \
      -v "$(pwd)":/data \
      --link mongo:mongo \
      -w /data/hw3-2and3-3/blog \
      -p 8082:8082 \
      -d node node app.js
  # or on one line for easy copy-paste
  docker run --name nodeapp -v "$(pwd)":/data --link mongo:mongo -w /data/hw3-2and3-3/blog -p 8082:8082 -d node node app.js
  </pre>
  <p>The following commands might be useful when running containers as daemons (replace <code>nodeapp</code> with ID or name of container):</p>
  <pre class="bash"># to see running containers
  docker ps
  # to check output of container
  docker logs nodeapp
  # to tail the output of container
  docker logs -f nodeapp
  # to stop running container
  docker stop nodeapp
  </pre>
  <h2 id="mongodb-course-manual-validation-tips">MongoDB Course Manual Validation Tips</h2>
  <iframe width="732" height="412" src="https://www.youtube.com/embed/TwzNfD1L3vM?list=PLOyuTJZcQNNDSVMlAkIEoPX9CDrOGyTVt" frameborder="0" allowfullscreen="allowfullscreen">[embedded content]</iframe>
  <p>If you using this for MongoDB University course and chose to do manual validation (haven't tested with MongoProc validation) you will need to keep a few things in your mind.</p>
  <p>For second week second homework it's not possible to configure the validation script and it tries to connect to Mongo database which is on localhost. To fix this open your <code>/etc/hosts</code> file (you might need to install some editor on your container), enter the <code>MONGOIP localhost</code> as the first entry (<strong>replace <code>MONGOIP</code> with mongo container IP address, should be in the same hosts file</strong>) and comment out the real <code>localhost</code> entry. Now running validation script should succeed and you should receive the validation code if you did homework assignment correctly. <strong>Don't forget to revert the changes to <code>/etc/hosts</code> file!!!</strong></p>
  <p>Other assignment validation is simpler as it allows to configure the validation script. Run validation with <code>--help</code> to see what is available for configuration. The defaults for web server should be correct (as you should have one container and two terminals for it, one running the application, another executing validation) you only need to change connection string for Mongo database. Enter the following to validate third week second assignment:</p>
  <pre class="bash">node hw3-2validate.js --db mongodb://mongo:27017/blog
  </pre>
  <p>If you done your homework correctly you should receive the validation code.</p>
  <h2 id="conclusion">Conclusion</h2>
  <p>Now you should have enough knowledge to be able to run MongoDB and NodeJS using Docker. You can take most of that knowledge and expand it to other containers even if you don't want to learn more about Docker. This would still provide you with ability to rapidly test your ideas and throw away the resources as needed.</p>
  <p>If you're using this for MongoDB University course it should help with most of the issues you could run while completing your assignments.</p>
  <p>If you're willing to hurt your ears by listening to my voice you can find the screen cast of this whole tutorial at <a href="https://www.youtube.com/playlist?list=PLOyuTJZcQNNDSVMlAkIEoPX9CDrOGyTVt">YouTube</a>. If you're listening on mute or can't understand what I'm saying the <a href="http://www.ifdattic.com/how-to-mongodb-nodejs-docker/scripts/screencast-how-to-mongo-node-docker">script for screen cast is available</a>.</p>
  <p>If you have any questions, suggestions or any part of it is unclear please leave a comment.</p>
  <blockquote>
    <p>If you liked this article and would like to learn more about developing web applications try out the <a href="https://www.packtpub.com/web-development/web-development-nodejs-and-mongodb-video">Web Development with Node.js and MongoDB</a> video course (created by me). In that course you will learn how to convert the ideas in your head to custom web applications. It covers the topics like preparing development environment, scaffolding a web application, storing data, working with RESTful APIs, testing your application and improving performance. <strong>Take the course and learn how to convert your ideas into web applications</strong>.</p>
  </blockquote>
          </div><p class="categories meta-content">
              Posted in:
                          <a href="http://www.ifdattic.com/blog/categories/Docker">Docker</a>,                         <a href="http://www.ifdattic.com/blog/categories/MongoDB">MongoDB</a>,                         <a href="http://www.ifdattic.com/blog/categories/Node.js">Node.js</a>,                         <a href="http://www.ifdattic.com/blog/categories/Technical">Technical</a>,                         <a href="http://www.ifdattic.com/blog/categories/Tips">Tips</a>                        </p>


title: API Request Caching with JSON & PHP | kevinleary.net
url: https://www.kevinleary.net/api-request-caching-json-php/
created_at: 2017-08-10 23:19:09
updated_at: 2017-08-10 23:19:09
mimetype: text/html
language: en
domain_name: www.kevinleary.net
preview_picture: https://www.kevinleary.net/wp-content/themes/kevinleary/images/kevin-leary-open-graph-logo.png
http_status: 200
content:
  <p>When I began working with API’s a few year ago I was incredibly excited. The amount of data I had at my fingertips was overwhelming. I had the ability to create a full scale application with someone else’s data, and it was was mind boggling. Today I find myself using API’s in almost every project I am a part of. They have become a vital aspect of any modern website, and a vital skill for any modern web developer.</p>
  <h2>API Requests are Slow</h2>
  <p>When you work with an API you are accessing someone else’s information. This process is generally very slow and the more information you request, the slower it gets. You are often limited to the number of times you can request data from someone. This makes server-side caching an ideal solution to dramatically improve the speed of displaying API results.</p>
  <h2>How Much Faster</h2>
  <p>I was recently working with a pretty large request to the <a href="http://www.indeed.com/jsp/apiinfo.jsp">Indeed API</a>. The response contained about 320 jobs, and took about <strong>4-5 seconds</strong> each time. The following caching method cut the request time down to <strong>0.08 seconds</strong>.</p>
  <h3>Not Convinced?</h3>
  <h2>The Caching Function</h2>
  <p>I’ve created this function to make it easy. It can easily be used with any API, just replace the <code>indeed_api_request()</code> function call.</p>
  <pre class="language-php">/**
   * API Request Caching
   *
   *  Use server-side caching to store API request's as JSON at a set 
   *  interval, rather than each pageload.
   * 
   * @arg Argument description and usage info
   */
  function json_cached_api_results( $cache_file = NULL, $expires = NULL ) {
      global $request_type, $purge_cache, $limit_reached, $request_limit;
      if( !$cache_file ) $cache_file = dirname(__FILE__) . '/api-cache.json';
      if( !$expires) $expires = time() - 2*60*60;
      if( !file_exists($cache_file) ) die("Cache file is missing: $cache_file");
      // Check that the file is older than the expire time and that it's not empty
      if ( filectime($cache_file) &lt; $expires || file_get_contents($cache_file)  == '' || $purge_cache &amp;&amp; intval($_SESSION['views']) &lt;= $request_limit ) {
          // File is too old, refresh cache
          $api_results = indeed_api_request();
          $json_results = json_encode($api_results);
          // Remove cache file on error to avoid writing wrong xml
          if ( $api_results &amp;&amp; $json_results )
              file_put_contents($cache_file, $json_results);
          else
              unlink($cache_file);
      } else {
          // Check for the number of purge cache requests to avoid abuse
          if( intval($_SESSION['views']) &gt;= $request_limit ) 
              $limit_reached = " &lt;span class='error'&gt;Request limit reached ($request_limit). Please try purging the cache later.&lt;/span&gt;";
          // Fetch cache
          $json_results = file_get_contents($cache_file);
          $request_type = 'JSON';
      }
      return json_decode($json_results);
  }
  </pre>
  <h3>How It Works</h3>
  <p>The function takes two arguments:</p>
  <ol><li>The <code>$cache_file</code> argument stores the server location of the cache file you wish to use. By default it will look for <code>api-cache.json</code> in the same directory as the script using this function.</li>
  <li>The <code>$expires</code> argument will store the time between each API request. By default a new API request will be made every 2 hours.</li>
  </ol><p><strong>You’ll need to create the cache file with <code>CHMOD 777</code> permissions before this function will work</strong>. The function will check to see if the cache file exists using <code>file_exists()</code>, throwing an error message if it does not. If the cache file exists, the script will check to see if it’s empty using <code>file_get_contents()</code>. If it is empty an initial API request is made and the results are stored as JSON in the cache file using <code>file_put_contents()</code>. If the cache file exists and is not empty the script will check the last time the file was modified using <code>filectime()</code>. If it was modified longer than the <code>$expires</code> time an API request is made and the file is updated.</p>
  <h2>Sample Indeed API Request</h2>
  <pre class="language-php">/**
   * Request jobs from Indeed API
   *
   * Split the request into smaller request chunks (25 results each)
   * and then consolidate them into a single array to meet the API
   * requirements.
   */
  function indeed_api_request( $split = 50, $search = 'company:("Google")', $apikey = 'XXXXXXXXXXXXXXXX' ) {
      // Get the goods for making the API request to Indeed
      $search = urlencode($search);
      $split = intval($split);
      $user_agent = urlencode( $_SERVER['HTTP_USER_AGENT'] );
      $server_ip = filter_var( $_SERVER['SERVER_ADDR'], FILTER_VALIDATE_IP );
      // Split API request into multiple queries, requesting "$split" results per request
      $xmlrpc = "http://api.indeed.com/ads/apisearch?publisher=$apikey&amp;q=$search&amp;userip=$server_ip&amp;useragent=$user_agent&amp;v=2&amp;limit=$split";
      $fullxml = simplexml_load_file( $xmlrpc );
      $totalresults = intval( $fullxml-&gt;totalresults );
      $loop_size = $totalresults / $split;
      $feeds = array();
      for ( $i = 0; $i &lt;= $loop_size; $i++ ) {
          $offset = $split * $i;
          $feeds[] = ( $i === 0 ) ? $xmlrpc : "$xmlrpc&amp;start=$offset";
      }
      // For each feed, store the results as an array
      $grouped_results = array();
      foreach ( $feeds as $feed ) {
          $xml = simplexml_load_file($feed);
          if( !$xml ) return false;
          $json = json_encode($xml);
          $grouped_results[] = json_decode($json, TRUE);
      }
      // Consolidate all grouped requests into a single, final results array
      $jobs = array();
      foreach ( $grouped_results as $job ) {
          $jobs = array_merge( (array) $jobs, (array) $job['results']['result'] );
      }
      return $jobs;
  }
  </pre>
  <p>This is a function I commonly use to retrieve the results of an XML-RPC request from the Indeed API. I can further elaborate if anyone is interested, let me know using the comments below.</p>
  <h3>Output the Results as HTML</h3>
  <p>I’ve used the function to display a nice HTML5 list of Indeed Jobs in <a href="https://www.kevinleary.net/wp-samples/indeed-api-cached-php-json.php">this PHP, API &amp; JSON caching demonstration</a>.</p>
  <pre class="language-php">/**
   * Format a basic job listing in HTML5
   */
  function indeed_job_results( $api_results = NULL, $search = NULL ) {
      if( !$api_results ) return false;
      $total = count($api_results);
      $search = ( $search ) ? " found for &amp;ldquo;&lt;strong&gt;$search&lt;/strong&gt;&amp;rdquo;" : "";
      $html = "&lt;section class='jobs'&gt;";
      $html .= "&lt;header&gt;";
      $html .= "&lt;h2&gt;$total jobs$search&lt;/h2&gt;";
      $html .= "&lt;/header&gt;";
      foreach ( $api_results as $job ) {
          $date = explode(' ', $job-&gt;date);
          $formattedDate = $date[2] . ' ' . $date[1] . ', ' . $date[3];
          $html .= "&lt;article&gt;";
          $html .= "&lt;h3&gt;&lt;a href='{$job-&gt;url}' target='_blank'&gt;{$job-&gt;jobtitle}&lt;/a&gt;&lt;/h3&gt;";
          $html .= "&lt;p class='details'&gt;{$job-&gt;formattedLocation} &lt;em&gt;&amp;ndash;&lt;/em&gt; $formattedDate&lt;/p&gt;";
          $html .= "&lt;/article&gt;";
      }
      $html .= "&lt;/section&gt;&lt;!--// end .jobs --&gt;";
      return $html;
  }
  </pre>
  <p>Using the function in practice is simple.</p>
  <pre class="language-php">$api_results = json_cached_api_results();
  $jobs_output = indeed_job_results( $api_results, 'Google' );
  </pre>
  <p>The result is a nice HTML5 display.</p>
  <pre class="language-markup">&lt;section class='jobs'&gt;
      &lt;header&gt;
          &lt;h2&gt;650 jobs found for &amp;ldquo;&lt;strong&gt;Google&lt;/strong&gt;&amp;rdquo;&lt;/h2&gt;
      &lt;/header&gt;
      &lt;article&gt;
          &lt;h3&gt;&lt;a href='http://www.indeed.com/viewjob?jk=caa97a24d40b837e&amp;qd=TGbcPDy5GuwvL2ECGUPcRQVLz8qYsMKyox4VZPgZ7gXWjz26eFGVblZsapiU4aPT2U8gcWTUmEjcpOm0ZWfmQW51jR-X4A2GOFW7z-vRUlFe9tF3N6NENrAfMFkmRemu&amp;indpubnum=5687187771681591&amp;atk=16cgptih60k2g7vc' target='_blank'&gt;Operations Technician (Temporary to Hire)&lt;/a&gt;&lt;/h3&gt;
          &lt;p class='details'&gt;Lenoir, NC &lt;em&gt;&amp;ndash;&lt;/em&gt; Oct 20, 2011&lt;/p&gt;
      &lt;/article&gt;
      &lt;article&gt;
          &lt;h3&gt;&lt;a href='http://www.indeed.com/viewjob?jk=e4032e384764608b&amp;qd=TGbcPDy5GuwvL2ECGUPcRQVLz8qYsMKyox4VZPgZ7gXWjz26eFGVblZsapiU4aPT2U8gcWTUmEjcpOm0ZWfmQW51jR-X4A2GOFW7z-vRUlFe9tF3N6NENrAfMFkmRemu&amp;indpubnum=5687187771681591&amp;atk=16cgptih60k2g7vc' target='_blank'&gt;Administrative Assistant&lt;/a&gt;&lt;/h3&gt;
          &lt;p class='details'&gt;New York, NY &lt;em&gt;&amp;ndash;&lt;/em&gt; Oct 20, 2011&lt;/p&gt;
      &lt;/article&gt;
  &lt;/section&gt;&lt;!--// end .jobs --&gt;
  </pre>
  <h2>In Conclusion</h2>
  <p>API’s provide access to incredibly amounts of data but it comes at a price. With speed and request limitations it’s important to have a solid method for caching your requests locally when working with an API’s in production. Hopefully this method helps you speed up your next API project!</p>
  <p>As always, if you have any questions don’t hesitate to ask.</p>

  						<h2>About the Author</h2>
  						<p>Kevin Leary is a <a href="https://www.kevinleary.net">web developer in Boston, MA</a> specializing in enterprise website design and development, online marketing, and conversion optimization.</p>


url: http://blog.hypriot.com/post/docker-compose-nodejs-haproxy/
created_at: 2017-08-10 23:19:10
updated_at: 2017-08-10 23:19:10
mimetype: text/html
language: en-us
domain_name: blog.hypriot.com
http_status: 200
title:
  How to use Docker Compose to run complex multi container apps on your Raspberry Pi · Docker Pirates ARMed with explosive stuff

content:
  Mon, Apr 6, 2015
      <p>In this blog post we gonna walk you through the different steps that are necessary to get you started with Docker Compose and show how to use it.</p><p>To demonstrate the benefits of Docker Compose we are going to create a simple Node.js “Hello World” application which will run on three Docker Node.js containers.
  HTTP requests will be distributed to these Node.js nodes by an HAProxy instance running on another Docker container.</p>
  <p>If you haven’t heard about Docker Compose its docs have a neat description of what it is all about:</p>
  <blockquote>
  <p>Compose is a tool for defining and running complex applications with Docker.
  With Compose, you define a multi-container application in a single file,
  then spin your application up in a single command which does everything that needs to be done to get it running.</p>
  </blockquote>
  <h2 id="a-hello-world-application">A Hello-World application</h2>
  <p>We start by creating a simple Hello-World <a href="https://nodejs.org">Node.js</a> web application based on <a href="http://expressjs.com/">Express.js</a>.</p>
  <p>To keep it simple we are only going to show a “Hello World” message and the hostname of the container.  This will be useful later on.</p>
  <h3 id="src-index-js">src/index.js</h3>
  <p>First we create a <code>src/index.js</code> file for the web application:</p>
  <pre class="language-javascript">var express = require('express');
  var os = require("os");
  var app = express();
  var hostname = os.hostname();
  app.get('/', function (req, res) {
    res.send('&lt;html&gt;&lt;body&gt;Hello from Node.js container ' + hostname + '&lt;/body&gt;&lt;/html&gt;');
  });
  app.listen(80);
  console.log('Running on http://localhost');
  </pre>
  <h3 id="src-package-json">src/package.json</h3>
  <p>Then we need to create a <code>src/package.json</code> file with the dependencies we need to build and start the Node.js application:</p>
  <pre class="language-json">{
    "name": "node-hello-world",
    "private": true,
    "version": "0.0.1",
    "description": "Node.js Hello world app on docker",
    "author": "hypriot.com",
    "dependencies": {
      "express": "4.12.0"
    }
  }
  </pre>
  <p>And that is all that is need to set up this small Hello-World application from the nods.js side of things.</p>
  <h3 id="dockerfile">Dockerfile</h3>
  <p>As we want to run our web application in a Docker container we now need to create a <code>Dockerfile</code> for that.
  The Dockerfile is simple and straightforward.</p>
  <pre># use our prepared Raspberry Pi compatible Docker base image with Node.js
  FROM hypriot/rpi-node:0.12.0
  # make the src folder available in the docker image
  ADD src/ /src
  WORKDIR /src
  # install the dependencies from the package.json file
  RUN npm install
  # make port 80 available outside of the image
  EXPOSE 80
  # start node with the index.js file of our hello-world application
  CMD ["node", "index.js"]
  </pre>
  <h2 id="running-one-container">Running one container</h2>
  <p>We can now test if our Node.js web server works by building a Docker application image first and then spinning it up as a new container.</p>
  <pre class="language-bash">$ docker build -t node-hello .
  $ docker run -p 80:80 --name web -d node-hello
  </pre>
  <p>Then we can check if the server is running with the following command</p>
  <pre class="language-bash">$ curl http://localhost
  &lt;html&gt;&lt;body&gt;Hello from Node.js container 38f69acbdf13&lt;/body&gt;&lt;/html&gt;
  </pre>
  <p>As we have published the port 80 to the host we also can access our web application from another machine.</p>
  <h3 id="benchmarking-our-web-application">Benchmarking our web application</h3>
  <p>As we are curious guys we want to know how well our Hello-World application performs on a Docker-Raspberry-Pi-Combo.</p>
  <p>So we are going to use <a href="https://httpd.apache.org/docs/2.2/programs/ab.html">Apache Bench</a> to do some benchmarking from another machine in the network.
  To install Apache Bench on Debian/Ubuntu use <code>sudo apt-get install apache2-utils</code>. On Mac OS X <code>ab</code> usually comes preinstalled.</p>
  <pre class="language-bash">$ ab -n 10000 -c 10 http://ip-of-your-rpi/
  </pre>
  <p>This runs 10.000 HTTP requests with a concurrency of 10. The CPU load while running the benchmark test shows that only one CPU core of the Raspberry Pi 2 is used. The reason is that Node.js is a single threaded process.</p>
  <p><img src="http://blog.hypriot.com/images/rpi-node-haproxy/htop-1-webserver.png" alt="htop with 1 webserver" /></p>
  <p>And here are the results of the Apache Bench test. As you can see a single web server can handle <strong>338</strong> Requests per second.</p>
  <pre class="language-bash">$ ab -n 10000 -c 10 http://192.168.33.200/
  This is ApacheBench, Version 2.3 &lt;$Revision: 655654 $&gt;
  Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
  Licensed to The Apache Software Foundation, http://www.apache.org/
  Benchmarking 192.168.33.200 (be patient)
  Completed 1000 requests
  Completed 2000 requests
  Completed 3000 requests
  Completed 4000 requests
  Completed 5000 requests
  Completed 6000 requests
  Completed 7000 requests
  Completed 8000 requests
  Completed 9000 requests
  Completed 10000 requests
  Finished 10000 requests
  Server Software:
  Server Hostname:        192.168.33.200
  Server Port:            80
  Document Path:          /
  Document Length:        67 bytes
  Concurrency Level:      10
  Time taken for tests:   29.499 seconds
  Complete requests:      10000
  Failed requests:        0
  Write errors:           0
  Total transferred:      2480000 bytes
  HTML transferred:       670000 bytes
  Requests per second:    338.99 [#/sec] (mean)
  Time per request:       29.499 [ms] (mean)
  Time per request:       2.950 [ms] (mean, across all concurrent requests)
  Transfer rate:          82.10 [Kbytes/sec] received
  Connection Times (ms)
                min  mean[+/-sd] median   max
  Connect:        1    1   2.0      1      78
  Processing:    10   28   5.6     26     108
  Waiting:        9   28   5.4     26     106
  Total:         13   29   5.8     27     109
  Percentage of the requests served within a certain time (ms)
    50%     27
    66%     27
    75%     28
    80%     28
    90%     38
    95%     39
    98%     47
    99%     53
   100%    109 (longest request)
  </pre>
  <h3 id="cleaning-up">Cleaning up</h3>
  <p>That’s it for our first test drive. We can now stop the web server container.</p>
  <pre class="language-bash">$ docker stop web
  </pre>
  <h2 id="running-multiple-container-with-docker-compose">Running multiple container with Docker Compose</h2>
  <p>To run more of these web servers we now use Docker Compose to create a farm of web servers which are running behind a <a href="http://www.haproxy.org">HAProxy</a> load balancer.</p>
  <p>As our mission is to make Docker and its toolset available on ARM we created a <code>docker-compose</code> binary ready to run on your Raspberry Pi.</p>
  <h3 id="installation">Installation</h3>
  <p>First we have to install Docker Compose for the ARM-based Raspberry Pi from our fork at <a href="https://github.com/hypriot/compose">https://github.com/hypriot/compose</a>.</p>
  <pre class="language-bash">$ sudo sh -c "curl -L https://github.com/hypriot/compose/releases/download/1.1.0-raspbian/docker-compose-`uname -s`-`uname -m` &gt; /usr/local/bin/docker-compose; chmod +x /usr/local/bin/docker-compose"
  </pre>
  <h3 id="docker-compose-yml">docker-compose.yml</h3>
  <p>To get our four container configuration set up we first need to create a <code>docker-compose.yml</code> file.
  We will need three containers <code>weba</code>, <code>webb</code> and <code>webc</code> based on our web application image and one <code>haproxy</code> container.</p>
  <pre class="language-yaml">weba:
    build: .
    expose:
      - 80
  webb:
    build: .
    expose:
      - 80
  webc:
    build: .
    expose:
      - 80
  haproxy:
    image: hypriot/rpi-haproxy
    volumes:
     - haproxy:/haproxy-override
    links:
     - weba
     - webb
     - webc
    ports:
     - "80:80"
     - "70:70"
    expose:
     - "80"
     - "70"
  </pre>
  <p>Each of the three web application containers exposes port 80.
  Additionally the HAProxy container will have (network) links to each of the three web application containers.
  Furthermore the HAProxy container will exposes port 80 as a central entry point to our Hello-World application webserver farm and its admin interface on port 70.</p>
  <h3 id="haproxy-haproxy-cfg">haproxy/haproxy.cfg</h3>
  <p>HAProxy needs a configuration file that is mapped into the container. Create a file <code>haproxy/haproxy.cfg</code> with the following content.</p>
  <pre>global
    log 127.0.0.1 local0
    log 127.0.0.1 local1 notice
  defaults
    log global
    mode http
    option httplog
    option dontlognull
    timeout connect 5000
    timeout client 10000
    timeout server 10000
  listen stats :70
    stats enable
    stats uri /
  frontend balancer
    bind 0.0.0.0:80
    mode http
    default_backend aj_backends
  backend aj_backends
    mode http
    option forwardfor
    # http-request set-header X-Forwarded-Port %[dst_port]
    balance roundrobin
    server weba weba:80 check
    server webb webb:80 check
    server webc webc:80 check
    # option httpchk OPTIONS * HTTP/1.1\r\nHost:\ localhost
    option httpchk GET /
    http-check expect status 200
  </pre>
  <p>HAProxy does a health check for each of our three web servers.</p>
  <h3 id="running-our-webserver-farm">Running our webserver farm</h3>
  <p>Now that we have set up all the necessary parts it is time to spin up all our Docker containers at once. Just run the command <code>docker-compose up</code> interactively to see what is happening or use option <code>-d</code> to start all containers in the background.</p>
  <pre class="language-bash">$ docker-compose up -d
  Recreating rpinodehaproxyexample_webb_1...
  Recreating rpinodehaproxyexample_webc_1...
  Recreating rpinodehaproxyexample_weba_1...
  Recreating rpinodehaproxyexample_haproxy_1...
  </pre>
  <p>This will spin up all of our three web application servers and one HAProxy instance. Only the HAProxy container can be reached from the outside and each request will be load balanced by HAProxy to one of our web servers.</p>
  <p>You can watch the logs of all our containers by running the following command.</p>
  <pre class="language-bash">$ docker-compose logs
  Attaching to rpinodehaproxyexample_haproxy_1, rpinodehaproxyexample_weba_1, rpinodehaproxyexample_webc_1, rpinodehaproxyexample_webb_1
  weba_1    | Running on http://localhost
  webc_1    | Running on http://localhost
  webb_1    | Running on http://localhost
  </pre>
  <p>Now we can use <code>curl</code> again to test our Hello-World application farm as whole.</p>
  <pre class="language-bash"># on your Raspberry Pi
  $ curl http://localhost
  &lt;html&gt;&lt;body&gt;Hello from Node.js container fa05496d9ce7&lt;/body&gt;&lt;/html&gt;~
  $ curl http://localhost
  &lt;html&gt;&lt;body&gt;Hello from Node.js container 1167459cdacc&lt;/body&gt;&lt;/html&gt;~
  $ curl http://localhost
  &lt;html&gt;&lt;body&gt;Hello from Node.js container 660840416a84&lt;/body&gt;&lt;/html&gt;~
  $ curl http://localhost
  &lt;html&gt;&lt;body&gt;Hello from Node.js container fa05496d9ce7&lt;/body&gt;&lt;/html&gt;~
  </pre>
  <p>As you can see the container name is different for each <code>curl</code> request.
  And the fourth request has the same container name as the first one.
  The HAProxy container forwards each request in a round robin fashion, so each web server gets only one third of the load.</p>
  <h3 id="benchmarking-our-web-application-farm">Benchmarking our web application farm</h3>
  <p>Let’s see how our web server farm fares compared to our single web application container instance from our first benchmark.</p>
  <pre class="language-bash">$ ab -n 10000 -c 30 http://ip-or-your-rpi/
  </pre>
  <p>Now we run 10.000 HTTP requests with a concurrency of 30. The CPU load while running the benchmark test now shows that all four CPU cores of the Raspberry Pi 2 are used.</p>
  <p><img src="http://blog.hypriot.com/images/rpi-node-haproxy/htop-3-webserver-haproxy.png" alt="htop with 3 webserver and haproxy" /></p>
  <p>And here are the results of the benchmark test itself.</p>
  <pre class="language-bash">$ ab -n 10000 -c 30 http://192.168.33.200/
  This is ApacheBench, Version 2.3 &lt;$Revision: 655654 $&gt;
  Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
  Licensed to The Apache Software Foundation, http://www.apache.org/
  Benchmarking 192.168.33.200 (be patient)
  Completed 1000 requests
  Completed 2000 requests
  Completed 3000 requests
  Completed 4000 requests
  Completed 5000 requests
  Completed 6000 requests
  Completed 7000 requests
  Completed 8000 requests
  Completed 9000 requests
  Completed 10000 requests
  Finished 10000 requests
  Server Software:
  Server Hostname:        192.168.33.200
  Server Port:            80
  Document Path:          /
  Document Length:        67 bytes
  Concurrency Level:      30
  Time taken for tests:   23.353 seconds
  Complete requests:      10000
  Failed requests:        0
  Write errors:           0
  Total transferred:      2480000 bytes
  HTML transferred:       670000 bytes
  Requests per second:    428.22 [#/sec] (mean)
  Time per request:       70.058 [ms] (mean)
  Time per request:       2.335 [ms] (mean, across all concurrent requests)
  Transfer rate:          103.71 [Kbytes/sec] received
  Connection Times (ms)
                min  mean[+/-sd] median   max
  Connect:        1    2   1.4      2      15
  Processing:     5   68  59.5     51     259
  Waiting:        4   67  59.3     51     259
  Total:          5   70  59.5     54     260
  Percentage of the requests served within a certain time (ms)
    50%     54
    66%     77
    75%     94
    80%    108
    90%    163
    95%    210
    98%    231
    99%    234
   100%    260 (longest request)
  </pre>
  <p>As you can see the cluster can handle <strong>428</strong> Requests per second. Strangely enough we do not get three times the requests per second that we might have expected.
  Right now we are not really sure what the reason for this behaviour is. This may or may not be due to the fact that the NIC of the Raspberry Pi is sharing its IO bandwidth via the USB2 port.</p>
  <p>Stopping our little webfarm is also easily done with</p>
  <pre class="language-bash">$ docker-compose stop
  Killing rpinodehaproxyexample_haproxy_1...
  Killing rpinodehaproxyexample_weba_1...
  Killing rpinodehaproxyexample_webc_1...
  Killing rpinodehaproxyexample_webb_1...
  </pre>
  <p>If you want to learn more about Docker Compose, just head over to the official documentation at <a href="https://docs.docker.com/compose/">https://docs.docker.com/compose/</a>.</p>
  <p>You can find the code of this example on GitHub at <a href="https://github.com/hypriot/rpi-node-haproxy-example">https://github.com/hypriot/rpi-node-haproxy-example</a>.</p>
  <p>We hope you enjoyed this little tour of Docker Compose!</p>
  <p>As always use the comments below to give us feedback and share it on our <a href="https://news.ycombinator.com/item?id=9329890">HackerNews-Thread</a>, Twitter or Facebook.</p>
      
      
  <noscript><div>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></div></noscript>
  <a href="https://disqus.com/" class="dsq-brlink">comments powered by Disqus</a>


title: Envoi de notifications Push sur terminaux iOS avec notnoop/java-apns - Le Blog d'Ippon Technologies
created_at: 2017-08-10 23:19:12
updated_at: 2017-08-10 23:19:12
mimetype: text/html
domain_name: blog.ippon.fr
preview_picture: http://blog.ippon.fr/wp-content/uploads/2014/06/notif_ctr_badge_2x.png
http_status: 200
url:
  https://blog.ippon.fr/2014/07/25/envoi-de-notifications-push-sur-terminaux-ios-avec-notnoopjava-apns/

content:
  <div class="row">
            <div class="col-sm-12 content-teaser">
                        </div>
            <div class="col-sm-12">
              <p>Il vous est sûrement arrivé de vouloir envoyer des notifications à un terminal iOS et d’ajouter cette fonctionnalité à votre application cliente. Le but de cet article est de vous présenter dans un premier temps le système de notification APNS d’Apple (Apple Push Notification Service). Puis, dans un second temps de vous présenter la librairie <a href="https://github.com/notnoop/java-apns">notnoop/java-apns</a> qui nous permettra d’envoyer des notifications à un terminal iOS. Enfin nous verrons comment traiter cette notification côté client iOS.</p>
  <h1><strong><em>APNS comment ça marche ?</em></strong></h1>
  <p>Les systèmes de notifications fonctionnent tous sur le même principe.</p>
  <p><a href="http://blog.ippon.fr/wp-content/uploads/2014/06/apns-notification-diagramme.png"><img class="alignnone  wp-image-10833" alt="apns-notification-diagramme" src="http://blog.ippon.fr/wp-content/uploads/2014/06/apns-notification-diagramme-300x200.png" width="357" height="238" /></a></p>
  <p>Un terminal s’enregistre auprès d’un serveur de gestion de notifications Push (GCM chez Google, APNS chez Apple, MPNS pour Microsoft). Le serveur de gestion de notifications envoie au terminal un numéro unique appelé “push token”. L’application cliente communique, via WebService par exemple, le “push token” à l’application serveur. Ensuite l’application serveur utilisera le push token afin d’identifier le destinataire de la notification lorsqu’il l’enverra au service de notification APNS. Ce dernier notifiera le terminal. Si le terminal est connecté au réseau, alors la notification lui sera envoyée immédiatement. Si le terminal n’est pas connecté au réseau, alors APNS stockera la notification et l’enverra lorsque le terminal se connectera. Une seule notification est sauvegardée et pour une durée maximale de 28 jours.</p>
  <h2>La transmission de données</h2>
  <p>La transmission des données entre l’application serveur, APNS et le terminal se fait par des flux JSON sur des connexions sockets TCP. Apple attache beaucoup d’importance à la sécurité. Cependant, la livraison des notifications n’est pas garantie.</p>
  <p>Les flux JSON sont cryptés via le protocole TLS. De plus, l’application serveur s’authentifie grâce à un certificat. Ce dernier est attaché à l’application et à un environnement (de développement OU de production). Si votre application serveur crée trop de sockets en peu de temps, cela peut être considéré par Apple comme une attaque de type DoS.</p>
  <p>Le flux JSON se compose de trois parties : l’identifiant du destinataire (le push token), la date d’expiration de la notification et le payload. Le payload est un dictionnaire JSON contenant les informations à transmettre. La taille du payload ne peut dépasser les 256 octets. Ce qui contraste avec le système de Google qui a une limite de 4 kilo-octets pour son payload.</p>
  <h2>Les types de notifications</h2>
  <p>Il y a différents types de notifications :</p>
  <ul><li>la bannière : la notification s’affiche dans la barre des notifications</li>
  </ul><p><a href="http://blog.ippon.fr/wp-content/uploads/2014/06/notif_ctr_banner_2x.png"><img class="size-medium wp-image-10835 aligncenter" alt="notif_ctr_banner_2x" src="http://blog.ippon.fr/wp-content/uploads/2014/06/notif_ctr_banner_2x-300x53.png" width="300" height="53" /></a></p>
  <ul><li>l’alerte : la notification s’affiche dans une popup</li>
  </ul><p><a href="http://blog.ippon.fr/wp-content/uploads/2014/06/notif_ctr_alert_2x.png"><img class="size-medium wp-image-10836 aligncenter" alt="notif_ctr_alert_2x" src="http://blog.ippon.fr/wp-content/uploads/2014/06/notif_ctr_alert_2x-300x187.png" width="300" height="187" /></a></p>
  <ul><li>le badge : une pastille s’affiche sur l’icône de l’application</li>
  </ul><p><a href="http://blog.ippon.fr/wp-content/uploads/2014/06/notif_ctr_badge_2x.png"><img class="size-full wp-image-10837 aligncenter" alt="notif_ctr_badge_2x" src="http://blog.ippon.fr/wp-content/uploads/2014/06/notif_ctr_badge_2x.png" width="159" height="164" /></a></p>
  <ul><li>le signal sonore : un son est émis à la réception de la notification sous réserve que le fichier audio soit présent sur le terminal</li>
  </ul><p>Le choix du type de la notification est défini par le développeur et peut être modifié par l’utilisateur dans le menu “Réglages/Notifications”.</p>
  <h1>Dans la pratique comment ça se passe ?</h1>
  <p>Pour la pratique, nous allons voir dans un premier temps comment envoyer des notifications push à l’APNS, puis nous verrons comment gérer la réception de la notification push sur un terminal iOS.</p>
  <p>Notre exemple va permettre de prévenir un utilisateur d’un nouveau message à lire. Nous partirons du principe que le message est stocké dans une base. Ce message, représenté par une classe “Message”, se compose d’un identifiant, d’un titre et d’un texte. L’accès à la base et la récupération du message via WebService ne seront pas traités ici. Dans notre base nous avons aussi la liste des utilisateurs avec le “push token” de leur terminal. Un utilisateur est représenté par une classe “Contact”. Côté client, nous afficherons une alerte et un badge.</p>
  <h2>Pré-requis</h2>
  <p>Lors de la réalisation du serveur de notification push, il vous faudra :</p>
  <ul><li>un compte développeur Apple pour pouvoir développer le client iOS et générer les certificats nécessaires</li>
  <li>un certificat pour l’utilisation du “Apple Push Notification Service” au format “PKCS12” (extension “.p12”) avec son mot de passe</li>
  </ul><h2>Envoyer une notification à APNS</h2>
  <p>Notre écriture du serveur de notification push sera faite grâce à la librairie “notnoop/java-apns”. Dans le même style de librairie, vous avez “<a href="https://code.google.com/p/javapns/" title="javaPNS">javaPNS</a>“. Le choix de “notnoop/java-apns” s’est fait par sa simplicité d’utilisation.</p>
  <p>Pour utiliser cette librairie, soit vous importez le jar dans votre projet, soit vous modifiez le “pom.xml” de votre projet pour y intégrer la dépendance vers la librairie. Dans le premier cas, vous pourrez télécharger le jar <a href="https://github.com/notnoop/java-apns/downloads" title="apns-0.1.5.jar">ici</a>. Si vous souhaitez modifier votre “pom.xml”, il faudra y ajouter :</p>
  <pre><code>    &lt;dependencies&gt;&#13;
          ...&#13;
          &lt;dependency&gt;&#13;
              &lt;groupId&gt;com.notnoop.apns&lt;/groupId&gt;&#13;
              &lt;artifactId&gt;apns&lt;/artifactId&gt;&#13;
              &lt;version&gt;0.2.3&lt;/version&gt;&#13;
          &lt;/dependency&gt;&#13;
          ...&#13;
      &lt;/dependencies&gt;</code></pre>
  <p>Le fonctionnement de notre serveur de notifications va être le suivant :</p>
  <ol><li>Récupération du message et de ses destinataires en base</li>
  <li>Création de la connexion au service APNS</li>
  <li>Construction de la notification push en se basant sur le message à envoyer</li>
  <li>Envoi de la notification push</li>
  </ol><h3>Récupération de notre message et des destinataires</h3>
  <p>Là, c’est vraiment pour l’exemple. Nous utilisons une méthode “find” prenant en paramètre l’identifiant du message à notifier. Cette méthode nous retourne une “HashMap&lt;Message, List&lt;Contact&gt;&gt;” :</p>
  <pre>HashMap&lt;Message, List&lt;Contact&gt;&gt; hmapMessage = messageDa.find(idMessage);</pre>
  <h3>Création de la connexion au service APNS</h3>
  <p>Ensuite nous allons créer une connexion vers le service APNS. Nous allons utiliser les classes <code>com.notnoop.apns.APNS</code> et <code>com.notnoop.apns.ApnsService</code>. Il y a une chose à savoir lors de la création de la connexion au service APNS, c’est qu’Apple a deux environnements, l’un pour le développement, l’autre pour la production. Il vous faudra un certificat “.p12” et un mot de passe pour chaque environnement.</p>
  <p>La connexion au service APNS se fait de la manière suivante :</p>
  <ul><li>En mode développement :</li>
  </ul><pre>ApnsService apnsService = APNS.newService()&#13;
      .withCert("le_chemin_vers_le/certificat.p12", "mot_de_passe_du_certificat")&#13;
      .withSandboxDestination()&#13;
      .build();</pre>
  <ul><li>En mode production :</li>
  </ul><pre>ApnsService apnsService  = APNS.newService()&#13;
      .withCert("le_chemin_vers_le/certificat.p12", "mot_de_passe_du_certificat")&#13;
      .withProductionDestination()&#13;
      .build();</pre>
  <p>La différence est faite par <code>.withProductionDestination()</code> et <code>.withSandboxDestination()</code>. Le premier va permettre d’accéder à l’APNS à l’adresse <code>gateway.push.apple.com</code> sur le port “2195”, et le second utilisera l’APNS de l’adresse <code>gateway.sandbox.push.apple.com</code> sur le même port.</p>
  <p>Vous pouvez ensuite appeler la méthode <code>testConnection()</code> de la classe <code>com.notnoop.apns.ApnsService</code> pour contrôler la connexion. En cas de problème, une exception de type <code>com.notnoop.exceptions.NetworkIOException</code> sera remontée.</p>
  <h3>Construction de la notification push</h3>
  <p>Maintenant que nous sommes connecté à l’APNS, nous allons construire notre notification. Comme vu dans la partie sur la transmission des données, la notification se compose de trois éléments : le token du destinataire, la date d’expiration et le payload. Ce que nous allons créer est le payload. Pour cela, nous utiliserons un objet <code>com.notnoop.apns.PayloadBuilder</code> dont nous récupérons une instance à partir de la méthode <code>APNS.newPayload()</code>. La création se fait de la manière suivante :</p>
  <pre>// Constructeur du payload.&#13;
  PayloadBuilder payloadBuilder = APNS.newPayload();&#13;
  // Nous créons l'alerte en y mettant le texte du message.&#13;
  payloadBuilder.alertBody(message.getTitre());&#13;
  // Nous ajoutons un bouton "Lire" qui sera en bas à droite de la popup d'alerte.&#13;
  payloadBuilder.actionKey("Lire");&#13;
  // Nous ajoutons un champs personnalisé pour ajouter l'identifiant de notre message.&#13;
  payloadBuilder.customField("idMessage", message.getId());&#13;
  // On ajoute le badge.&#13;
  payloadBuilder.badge(1);</pre>
  <p>Attardons nous un moment sur la structure du payload. Ce dernier est un dictionnaire JSON référencé dans le flux de la notification par la clé “aps”. Il peut contenir les informations suivantes :</p>
  <ul><li>alert : Chaîne de caractères ou dictionnaire JSON. Si cette propriété est présente, alors le système affichera une popup d’alerte standard. Si la valeur spécifiée est une chaîne de caractères, alors cette dernière sera utilisée comme texte dans la popup. Il est possible d’utiliser un dictionnaire JSON afin de paramétrer la popup d’alerte. Ce dictionnaire pourra comprendre les clés suivantes :</li>
  <li>
  <ul><li>body : permettra de définir le texte à afficher.</li>
  <li>action-loc-key : si une chaîne de caractères est spécifiée, alors 2 boutons sont affichés dans la popup d’alerte.</li>
  <li>loc-key : clé d’un message dans un fichier “Localizable.string” permettant d’afficher un message en fonction de la langue de l’utilisateur. La clé peut contenir “%@” et “%n$@” afin d’afficher dans le message les variables spécifiées dans loc-args.</li>
  <li>loc-args : tableau de chaînes de caractères qui seront les arguments du loc-key.</li>
  <li>launch-image : chemin du fichier de l’image à afficher sur la notification.</li>
  </ul></li>
  <li>badge : numéro qui sera affiché dans le badge de l’icône de l’application.</li>
  <li>sound : chaîne de caractères permettant de définir le nom du fichier contenant le son qui sera joué à la réception de la notification.</li>
  <li>content-available : utilisé avec la valeur 1, permet d’indiquer la disponibilité de nouveau contenu.</li>
  </ul><p>Nous pouvons ajouter au dictionnaire du payload des champs personnalisés. C’est l’utilité du “customFields”. Dans notre payload, nous avons donc :</p>
  <ul><li>le dictionnaire “alert” avec un “body” qui contiendra le titre de notre message, et un “action-loc-key” qui affichera le bouton “Lire”.</li>
  <li>un badge à 1</li>
  <li>un champs personnalisé contenant l’identifiant de notre message</li>
  </ul><p>Le flux JSON produit sera :</p>
  <pre>{&#13;
      "idMessage": "12",&#13;
      "aps": {&#13;
          "alert": {&#13;
              "body": "Le titre du message à afficher",&#13;
              "action-loc-key": "Lire"&#13;
          },&#13;
          "badge": 1&#13;
      }&#13;
  }</pre>
  <p>Pour rappel, le payload ne peut excéder 256 octets. Nous contrôlons donc sa taille ainsi :</p>
  <pre>// Si le payload dans sa totalité dépasse 256 octets&#13;
  if (payloadBuilder.isTooLong()) {&#13;
      // Réduction du message afin de rentrer dans les 256 octets&#13;
      payloadBuilder = payloadBuilder.shrinkBody();&#13;
  }</pre>
  <p>La méthode “shrinkBody()” va réduire le champs “body” afin d’obtenir une taille inférieure ou égale à 256 octets.</p>
  <p>Nous validons la construction de notre payload et le récupérons dans une String :</p>
  <pre>String payload = payloadBuilder.build();</pre>
  <h3>Envoi de la notification push</h3>
  <p>L’envoi de la notification push se fait par la méthode <code>push(...)</code> de la classe <code>com.notnoop.apns.ApnsService</code><code>. Les différents prototypes de cette méthode sont :</code></p>
  <pre id="LC67">ApnsNotification push(String deviceToken, String payload) throws NetworkIOException;</pre>
  <pre id="LC68">EnhancedApnsNotification push(String deviceToken, String payload, Date expiry) throws NetworkIOException;</pre>
  <div>
  <pre id="LC100">Collection&lt;? extends ApnsNotification&gt; push(Collection&lt;String&gt; deviceTokens, String payload) throws NetworkIOException;</pre>
  <pre id="LC101">Collection&lt;? extends EnhancedApnsNotification&gt; push(Collection&lt;String&gt; deviceTokens, String payload, Date expiry) throws NetworkIOException;</pre>
  </div>
  <p>Les deux premières méthodes permettent d’envoyer une notification à l’APNS à destination d’un seul terminal. La deuxième spécifie la date d’expiration.</p>
  <p>Les deux dernières méthodes permettent d’envoyer une notification à destination de plusieurs terminaux.</p>
  <p>Dans tous les cas, si un problème est détecté, une exception sera levée. De plus, chacune des méthodes retourne un objet de type <code>ApnsNotification</code> ou <code>EnhancedApnsNotification</code> qui représente la notification envoyé à l’APNS.</p>
  <p>La librairie “notnoop/java-apns” a l’avantage de nous abolir de tout ce qui est gestion de file d’attente du service APNS, et gestion d’erreurs. Pour chaque notification, on va chercher à récupérer le socket TCP. S’il n’existe pas, il sera créé et, si la création n’est pas possible, une exception est levée. Lorsque le socket est ouvert, on envoie la notification. Si l’envoi échoue, on recommence trois fois. Au bout de trois échecs, on ferme le socket et on passe à la notification suivante. La librairie permet une gestion simplifiée du feedback.</p>
  <h3>C’est quoi le feedback ?</h3>
  <p>Le feedback permet de savoir pourquoi l’envoi d’une notification a échoué. Si une date d’expiration est spécifiée lors de l’envoi de la notification, son dépassement n’est pas considéré comme un échec et n’est pas pris en compte par le feedback. Les erreurs de livraison sont, en général, dues aux terminaux sur lesquels l’application a été supprimée.</p>
  <p>Lors du développement d’un serveur de notification push, de manière classique, on ouvre un socket dans lequel est écrit un message et un push token. Lorsqu’il y a plusieurs terminaux à notifier, on effectue une boucle. Si un terminal n’est plus enregistré, suite à la suppression de l’application par exemple, APNS s’arrêtera sur le push token invalide et refusera de continuer. Le “Feedback Service” permet de connaître les “push token” invalides avant d’effectuer l’envoi.</p>
  <p>Lorsque l’on crée notre connexion à l’APNS avec la librairie “notnoop/java-apns”, la gestion du feedback est activée. Il est possible de récupérer la liste des push token des terminaux qui ne sont plus valides. Cela se fera ainsi :</p>
  <pre>ApnsService apnsService = APNS.newService()&#13;
      .withCert("le_chemin_vers_le/certificat.p12", "mot_de_passe_du_certificat")&#13;
      .withSandboxDestination()&#13;
      .build();&#13;
  Map&lt;String, Date&gt; listeTerminauxInvalides = apnsService.getInactiveDevices();</pre>
  <p>La méthode <code>getInactiveDevices()</code> retourne une liste de clé/valeur. La clé correspond au token du terminal. La valeur correspond à la date à partir de laquelle l’application est considérée comme supprimée du terminal. Il est facile d’effectuer la suppression des terminaux inactifs de la liste des terminaux à notifier.</p>
  <h2>Et côté client ?</h2>
  <p>Côté client iOS, nous allons faire deux choses. La première est de faire en sorte que le terminal s’enregistre auprès de l’APNS. La seconde est la gestion de la réception de la notification. Lorsque le terminal est actif, on va recevoir la notification et elle sera traitée en fonction de l’état de l’application. Le traitement de la notification n’est pas effectué par les mêmes méthodes si l’application est lancée, tourne en tâche de fond, ou bien fermée. Les principales modifications de code vont se faire dans le fichier “AppDelegate.m”.</p>
  <h3>Enregistrement du terminal</h3>
  <p>Dans un premier temps, nous allons enregistrer le terminal. Lorsqu’un terminal s’enregistre auprès de l’APNS, ce dernier lui fournit un numéro unique, le fameux “push token”. Ce numéro ne lui est pas attribué <em>ad vitam aeternam</em>. Il peut être modifié suite à un changement de l’application ou bien lorsque cette dernière est supprimée puis réinstallée, par exemple.</p>
  <p>L’enregistrement se fait via l’appel de la méthode <code>registerForRemoteNotificationTypes</code> de la classe <code>UIApplication</code>. Cela nous donne la ligne de code suivante :</p>
  <pre>[[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeSound)];</pre>
  <p>Les constantes “UIRemoteNotificationTypeAlert” et “UIRemoteNotificationTypeSound” qui sont passées en paramètre de la méthode précisent le type des notifications attendues. Ici, nous inscrivons notre terminal pour la réception des notifications de type “alert” et “sound”. La notification que nous avons créée précedemment avec le serveur de notification est justement de type “alert”.</p>
  <p>Lorsque l’enregistrement s’effectue avec succès, l’APNS retourne le “push token” à notre application par la méthode <code>didRegisterForRemoteNotificationsWithDeviceToken</code>. Nous implémenterons cette méthode afin d’effectuer la sauvegarde du “push token” et sa transmission en base de données via un WebService. Ainsi, dans notre exemple, le serveur de notifications pourra le récupérer dans les objets “Contact”. En cas d’échec de l’enregistrement, la méthode <code>didFailToRegisterForRemoteNotificationsWithError</code> sera appelée. Elle fait donc partie des méthodes à implémenter.</p>
  <p>Nous faisons en sorte que la méthode <code>registerForRemoteNotificationTypes</code> soit appelée au lancement de l’application. Son appel se fera dans la méthode <code>didFinishLaunchingWithOptions</code>. Nous allons avoir un code ressemblant à :</p>
  <pre>- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {&#13;
  &#13;
      // On appelle la méthode "startApp" effectuant les traitements au démarrage&#13;
      // dont l'enregistrement de notre terminal&#13;
      [self startApp];&#13;
  &#13;
      if (launchOptions != nil) {&#13;
          // Si l'on passe ici c'est que l'application est lancé suite à un "tap" ou "slide"&#13;
          // sur la notification. Du coup la notification est passée en paramètre de la méthode.&#13;
          // On récupère l'identifiant du message&#13;
          self.messageId = [[launchOptions objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey] objectForKey:@"idMessage"];&#13;
  &#13;
          // On va rechercher le message en base de données via un appel à un WebService.&#13;
          // Vous utiliserez peut-être une autre manière de faire en fonction de votre projet.&#13;
          [self downloadAndSaveMessageWithId:self.messageId];&#13;
  &#13;
          // Ensuite on effectue une redirection vers l'affichage du message&#13;
          [self displayMessageDetailWhenNotificationRecieved];&#13;
      }    &#13;
      return YES;&#13;
  }&#13;
  &#13;
  /**&#13;
   * Méthode appelée lors du démarrage de l'application afin &#13;
   * d'effectuer l'enregistrement du terminal.&#13;
   */&#13;
  - (void)startApp {&#13;
      // On enregistre le terminal sur les notifications de type "alert" et "sound"&#13;
      [[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeSound)];&#13;
  &#13;
      self.window = [[UIWindow alloc] initWithFrame:UIScreen.mainScreen.bounds];&#13;
      // Dans notre cas nous effectuons un traitement particulier en fonction du modèle de l'IPhone&#13;
      self.storyboard = [[UIStoryboard alloc]init];&#13;
      if(IS_IPHONE_5) {&#13;
          self.storyboard = [UIStoryboard storyboardWithName:@"Main_iPhone5" bundle:nil];&#13;
      } else {&#13;
          self.storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];        &#13;
      }&#13;
  &#13;
      UIViewController *viewController;&#13;
  &#13;
      // Ici nous effectuons un contrôle sur le fait que l'utilisateur s'est enregistré&#13;
      // ou pas sur l'application. J'ai laissé ce code pour vous montrer comment vous &#13;
      // rediriger vers un écran particulier.&#13;
      BOOL isAuthentified = [[Sauvegarde instance] isAuthentified];&#13;
  &#13;
      if (isAuthentified) {&#13;
          viewController = [self.storyboard instantiateViewControllerWithIdentifier:@"ExpertTabBarControllerId"];&#13;
      } else {        &#13;
          viewController = [self.storyboard instantiateViewControllerWithIdentifier:@"NavFirstUseViewControllerID"];&#13;
      }&#13;
  &#13;
      self.window.rootViewController = viewController;&#13;
  &#13;
      [self.window makeKeyAndVisible];&#13;
  }&#13;
  &#13;
  /**&#13;
   * Méthode permettant de récupérer le push token retourné par le service &#13;
   * Apple Push Notification Service. &#13;
   * C'est dans cette méthode que vous enregistrez le push token&#13;
   */&#13;
  - (void)application:(UIApplication *)app didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)devToken {&#13;
  &#13;
      const void *devTokenBytes = [devToken bytes];&#13;
  &#13;
      // Récupération du push token&#13;
      NSString *pushToken = [[devToken description] stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"&lt;&gt;"]];&#13;
      pushToken = [pushToken stringByReplacingOccurrencesOfString:@" " withString:@""];&#13;
  &#13;
      // Le push token est ensuite sauvegardé dans un objet "Sauvegarde"&#13;
      // singleton permettant de sauvegarder des données au sein de l'application&#13;
      [[Sauvegarde instance]addPushToken:pushToken];&#13;
      [[Sauvegarde instance]savePushToken];&#13;
  &#13;
      NSLog(@"pushToken = *%@*",pushToken);&#13;
  &#13;
      // Ici c'est à vous de jouer en fonction de votre projet&#13;
      // pour envoyer le push token dans une base de données.&#13;
      //[self sendProviderDeviceToken:devTokenBytes]; &#13;
  &#13;
  }&#13;
  &#13;
  /**&#13;
   * Cette méthode est appelée en cas d'échec de l'enregistrement du terminal.&#13;
   * Ici nous ne faisons que logguer l'erreur, mais nous pourrions afficher un &#13;
   * message à l'utilisateur ou effectuer un traitement particulier.&#13;
   */&#13;
  - (void)application:(UIApplication *)app didFailToRegisterForRemoteNotificationsWithError:(NSError *)err {&#13;
  &#13;
      NSLog(@"Error in registration. Error: %@", err);&#13;
  &#13;
  }</pre>
  <h3>Réception de la notification Push</h3>
  <p>Maintenant que nous avons enregistré notre terminal, nous allons gérer la réception de notre notification. Comme nous l’avons vu précédemment, il y a trois cas à prendre en compte :</p>
  <ol><li>nous recevons la notification alors que l’application est fermée</li>
  <li>nous recevons la notification alors que l’application est en cours d’utilisation</li>
  <li>nous recevons la notification alors que l’application est en tâche de fond</li>
  </ol><p>Ces trois cas d’utilisations sont gérés par deux méthodes : <code>didFinishLaunchingWithOptions</code> et <code>didReceiveRemoteNotification</code>. La première méthode permet la gestion du cas où l’application est fermée. La seconde méthode permet la gestion des deux autres cas.</p>
  <h4>Traitons le cas lorsque l’application est fermée</h4>
  <p>Dans ce cas, lorsque le terminal de l’utilisateur reçoit une notification, elle s’affiche dans le “Notification center” et dans la barre des notifications. Lorsque l’utilisateur “tap” ou “slide” la notification, cela va lancer notre application. Un appel à la méthode <code>didFinishLaunchingWithOptions</code> sera fait avec en paramètre le dictionnaire JSON de notre notification. Nous récupérons l’identifiant du nouveau message. Nous l’utilisons pour récupérer le message en base de données via un appel WebService. Puis nous redirigeons l’utilisateur vers l’écran d’affichage du message. Notre code ressemble à :</p>
  <pre>- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {&#13;
  &#13;
      // On appelle la méthode "startApp" effectuant les traitements au démarrage&#13;
      // dont l'enregistrement de notre terminal&#13;
      [self startApp];&#13;
  &#13;
      if (launchOptions != nil) {&#13;
          // Si l'on passe ici c'est que l'application est lancé suite à un "tap" ou "slide"&#13;
          // sur la notification. Du coup la notification est passée en paramètre de la méthode.&#13;
          // On récupère l'identifiant du message&#13;
          self.messageId = [[launchOptions objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey] objectForKey:@"idMessage"];&#13;
  &#13;
          // On va rechercher le message en base de données via un appel à un WebService.&#13;
          // Vous utiliserez peut être une autre manière de faire en fonction de votre projet.&#13;
          [self downloadAndSaveMessageWithId:self.messageId];&#13;
  &#13;
          // Ensuite on effectue une redirection vers l'affichage du message&#13;
          [self displayMessageDetailWhenNotificationRecieved];&#13;
      }    &#13;
      return YES;&#13;
  }&#13;
  &#13;
  /**&#13;
   * Cette méthode récupère le message à afficher de la base de données&#13;
   * puis le sauvegarde dans notre singleton "Sauvegarde".&#13;
   */&#13;
  - (void)downloadAndSaveMessageWithId:(NSString*)idMessage&#13;
  {&#13;
      NSString* token = [[Sauvegarde instance]getToken];&#13;
  &#13;
      [[MessageManager sharedManager] loadListeMessagesWithToken:(NSString *)token withMessageId:(NSString *)idMessage withSuccess:^(NSMutableArray *messages) {&#13;
  &#13;
          for (ListeMessages *lMessage in messages) {&#13;
              for (Message *message in lMessage.listeMessages) {&#13;
                  [Utils downloadAndSaveMessage:message];&#13;
              }&#13;
          }&#13;
  &#13;
          [[Sauvegarde instance] saveMessages];&#13;
          NSLog(@"Message id: %@ sauvegardé",idMessage);&#13;
      } failure:^(RKObjectRequestOperation *operation, NSError *error) {&#13;
          NSLog(@"Echec de la sauvegarde du message id: %@",idMessage);&#13;
      }];&#13;
  }&#13;
  &#13;
  /**&#13;
   * Cette méthode récupère les données du message afin&#13;
   * de valoriser les champs pour l'affichage. On est ensuite&#13;
   * redirigé vers le ViewController gérant cet affichage.&#13;
   */&#13;
  - (void)displayMessageDetailWhenNotificationRecieved&#13;
  {&#13;
      // La notification est considérée comme consommée.&#13;
      // On peut donc décrémenter l'indicateur du badge.&#13;
      [UIApplication sharedApplication].applicationIconBadgeNumber--;&#13;
  &#13;
      // On récupère notre message&#13;
      NSDictionary* messages = [NSDictionary dictionaryWithDictionary:[[Sauvegarde instance] messages]];&#13;
  &#13;
      // Notre application utilise une tabBar permettant à l'utilisateur de sélectionner&#13;
      // l'affichage des message.&#13;
      UITabBarController *tabb = (UITabBarController *)self.window.rootViewController;&#13;
  &#13;
      // On récupère le contrôleur affichant le message.&#13;
      DetailMsgExpertControllerViewController *detail = [self.storyboard instantiateViewControllerWithIdentifier:@"detailMsgViewController"];&#13;
  &#13;
      // On valorise les champs avec les données du message&#13;
      NSString *idMessage = self.messageId;&#13;
      detail.mTitre = messages[idMessage][@"titre"];&#13;
      detail.mTexte = messages[idMessage][@"texte"];&#13;
      NSDate *date = messages[idMessage][@"dateMessage"];&#13;
  &#13;
      // On formatte la date&#13;
      detail.mDate = [Utils getDateMessageLabel:date];&#13;
  &#13;
      // On se dirige vers l'affichage du message à partir de notre tabBar.&#13;
      [(UINavigationController *)tabb.selectedViewController pushViewController:detail animated:YES];    &#13;
  }</pre>
  <h4>Traitons les cas où l’application est active ou en tâche de fond</h4>
  <p>Lorsque l’application est active, la notification envoyée au terminal est reçue par la méthode <code>didReceiveRemoteNotification</code>. Dans cette méthode, nous allons créer la popup d’alerte et l’afficher. De plus, nous contrôlerons l’état de l’activité de l’application pour savoir si elle tourne en tâche de fond.</p>
  <pre>/**&#13;
   * Méthode permettant de gérer la réception d'une notification&#13;
   * push lorsque l'application est active.&#13;
   * La méthode reçoit en entrée le flux JSON constituant la &#13;
   * notification Push.&#13;
   */&#13;
   - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)notificationInfo {&#13;
      NSLog(@"remote notification: %@",[notificationInfo description]);&#13;
      // Récupération du payload&#13;
      NSDictionary *apsInfo = [notificationInfo objectForKey:@"aps"];&#13;
  &#13;
      // Récupération du dictionnaire décrivant l'alerte&#13;
      NSDictionary *alert = [apsInfo objectForKey:@"alert"];&#13;
      NSLog(@"Received Push Alert: %@", alert);&#13;
  &#13;
      // On récupère et on sauvegarde notre message&#13;
      self.messageId = [notificationInfo objectForKey:@"idMessage"];&#13;
      [self downloadAndSaveMessageWithId:self.messageId];&#13;
      NSLog(@"Message id : %@", self.messageId );&#13;
  &#13;
      // On fera vibrer le terminal&#13;
      AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);&#13;
  &#13;
      // On incrémente le badge de 1.&#13;
      NSString *badge = [apsInfo objectForKey:@"badge"];&#13;
      NSLog(@"Received Push Badge: %@", badge);&#13;
      [UIApplication sharedApplication].applicationIconBadgeNumber++;&#13;
  &#13;
      // On récupère le texte à afficher dans le body de l'alert&#13;
      NSString* message = [alert objectForKey:@"body"];&#13;
  &#13;
      // On récupère le libellé du bouton de droite&#13;
      NSString* libelleButton = [alert objectForKey:@"action-loc-key"];&#13;
  &#13;
      // On teste si l'état de l'application est actif ou pas&#13;
      if (application.applicationState == UIApplicationStateActive) {&#13;
          // L'application est en cours d'utilisation on affiche la popup&#13;
          UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Notification"&#13;
                                                              message:message&#13;
                                                             delegate:self&#13;
                                                    cancelButtonTitle:@"Annuler"&#13;
                                                    otherButtonTitles:libelleButton,nil];&#13;
          alertView.alertViewStyle = UIAlertViewStyleDefault;&#13;
          [alertView show];        &#13;
      } else {&#13;
          // Si l'application tourne en tâche de fond on redirige directement &#13;
          // vers l'écran d'affichage du message.&#13;
          [self displayMessageDetailWhenNotificationRecieved];&#13;
      }&#13;
  }</pre>
  <h1>En conclusion</h1>
  <p>Nous avons pu voir que l’envoi d’une notification Push grâce à la librairie “notnoop/java-apns” se fait de manière simple. La connexion au service “feedback” est transparente et la récupération des terminaux invalides est très simple. La réception et la gestion de cette notification sur un terminal iOS, sans être triviales pour un débutant, n’est pas compliquée en soi.  “notnoop/java-apns” offre une API simple d’utilisation et facile à mettre en place quelle que soit la taille du projet.</p>
  <p>Références :</p>
  <ul><li><a href="https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/ApplePushService.html#//apple_ref/doc/uid/TP40008194-CH100-SW1">La documentation officielle d’Apple sur les notification push.</a></li>
  <li><a href="http://blog.octo.com/etat-de-lart-du-push-sur-ios-android-et-windows-phone/">Un article présentant les systèmes de notification push de Google, Apple et Microsoft.</a></li>
  <li><a href="http://quickblox.com/developers/How_to_create_APNS_certificates">Guide de création de l’APP Id et du certificat APNS.</a></li>
  </ul><div id="socialButtonOnPage" class="leftSocialButtonOnPage"><div class="csbwfs-sbutton-post"><div id="fb-p" class="csbwfs-fb"><a href="javascript:" target="_blank" title="Share On Facebook"><i class="csbwfs_facebook"></i></a></div></div><div class="csbwfs-sbutton-post"><div id="tw-p" class="csbwfs-tw"><a href="javascript:" title="Share On Twitter"><i class="csbwfs_twitter"></i></a></div></div><div class="csbwfs-sbutton-post"><div id="gp-p" class="csbwfs-gp"><a href="javascript:" title="Share On Google Plus"><i class="csbwfs_plus"></i></a></div></div><div class="csbwfs-sbutton-post"><div id="li-p" class="csbwfs-li"><a href="javascript:" title="Share On Linkedin"><i class="csbwfs_linkedin"></i></a></div></div><div class="csbwfs-sbutton-post"><div id="pin-p" class="csbwfs-pin"><a href="denied:javascript:void(0);" title="Share On Pinterest"><i class="csbwfs_pinterest"></i></a></div></div><div class="csbwfs-sbutton-post"><div id="ml-p" class="csbwfs-ml"><a href="mailto:amsouber@ippon.fr" title="Contact us"><i class="csbwfs_mail"></i></a></div></div></div><div class="yarpp-related">
  <h3>Vous aimerez aussi</h3><ul><li><a href="https://blog.ippon.fr/2014/07/28/envoi-et-utilisation-des-notifications-push-sous-android/" rel="bookmark" title="Envoi et utilisation des Notifications Push sous Android">Envoi et utilisation des Notifications Push sous Android </a></li>
  <li><a href="https://blog.ippon.fr/2012/04/11/resultat-du-concours-tatami-pour-devoxx-france/" rel="bookmark" title="Résultat du concours “Tatami” pour Devoxx France">Résultat du concours “Tatami” pour Devoxx France </a></li>
  <li><a href="https://blog.ippon.fr/2012/04/23/les-presentations-ippon-a-devoxx-france-2012-sont-disponibles/" rel="bookmark" title="Les présentations Ippon à Devoxx France 2012 sont disponibles">Les présentations Ippon à Devoxx France 2012 sont disponibles </a></li>
  <li><a href="https://blog.ippon.fr/2012/10/05/bilan-coding-party-1/" rel="bookmark" title="Bilan de la coding party #1">Bilan de la coding party #1 </a></li>
  </ul></div>
            </div>
          </div>


title: Envoi et utilisation des Notifications Push sous Android - Le Blog d'Ippon Technologies
url: https://blog.ippon.fr/2014/07/28/envoi-et-utilisation-des-notifications-push-sous-android/
created_at: 2017-08-10 23:19:15
updated_at: 2017-08-10 23:19:15
mimetype: text/html
domain_name: blog.ippon.fr
preview_picture: http://blog.ippon.fr/wp-content/uploads/2014/06/gcm-notification-diagramme-300x203.png
http_status: 200
content:
  <div class="row">
            <div class="col-sm-12 content-teaser">
                        </div>
            <div class="col-sm-12">
              <p>Durant la vie d’une application mobile, il arrive que nous ayons besoin de prévenir l’utilisateur d’un changement. Ce dernier peut concerner une mise à jour de l’application, une nouvelle extension ou des événements concernant l’utilisateur. Pour répondre à ce besoin, il y a le système de notifications.</p>
  <p>Dans cet article nous allons voir les mécanismes d’envoi et de traitement des notifications pour le système Android. Pour ceux qui seraient intéressés par les notifications push dans le monde Apple, sachez que ce sera l’objet d’un <a href="http://blog.ippon.fr/2014/07/25/envoi-de-notifications-push-sur-terminaux-ios-avec-notnoopjava-apns/">autre article</a>.</p>
  <p>Pour utiliser les notifications dans un projet Android il faut lui ajouter les APIs GCM (Google Cloud Messaging).</p>
  <h2>Présentation de GCM</h2>
  <p>“Google Cloud Messaging for Android” est un service de Google pemettant l’envoi de notifications Push à des terminaux. Dans le monde Google, on distingue la “notification Push” de la “notification Android” qui, elle, s’affichera dans la barre des notifications. Pour utiliser GCM, il faut l’ajouter au projet dans le “Google Developer Console”. Nous verrons comment par la suite.</p>
  <p>Cette API permet d’envoyer, au format JSON, un message d’une taille maximale de 4ko. Ce message va contenir des paramètres propres à la notification, comme sa durée de vie, le ou les destinataires, mais également des informations à traiter par le terminal.</p>
  <p>GCM utilise deux protocoles : GCM HTTP et CCS (XMPP). Il est possible d’utiliser les deux en même temps. Les différences entre ces protocoles sont :</p>
  <ol><li><em>La direction des messages :</em>
  <ul><li>GCM HTTP est unidirectionnel “cloud-to-device” (downstream). C’est à dire que l’application serveur envoie un message à GCM pour notifier un ou plusieurs terminaux puis GCM envoie cette notification aux terminaux.</li>
  <li>CCS est multidirectionnel “device-to-cloud, cloud-to-device” (upstream, downstream). L’application server utilise une connexion persistente XMPP lui permettant d’envoyer et de recevoir des messages aux terminaux.</li>
  </ul></li>
  <li><em>La synchronisation :</em>
  <ul><li>GCM HTTP est synchrone. Tant que la réponse à la requête HTTP POST n’a pas été reçue, l’envoi de la notification suivante est bloqué.</li>
  <li>CCS est asynchrone.</li>
  </ul></li>
  <li><em>Le flux JSON :</em>
  <ul><li>GCM HTTP envoi le flux JSON de manière classique via une requête HTTP POST.</li>
  <li>CCS encapsule le flux JSON dans un message XMPP.</li>
  </ul></li>
  </ol><p>Dans le cadre de cet article nous utiliserons GCM HTTP, notre besoin étant simplement de notifier un ou plusieurs terminaux d’un nouveau message pour l’utilisateur. Une des contraintes de GCM est la limite des destinataires du message. Lors d’un appel à GCM pour l’envoi d’un message, le nombre maximal de destinataires est limité à 1000. Si l’on souhaite notifier, 25000 terminaux il faudra faire une boucle sur l’appel.</p>
  <h2>Principe de fonctionnement</h2>
  <p>Afin d’expliquer le fonctionnement de la notification Android, basons-nous sur le schéma suivant :</p>
  <p><a href="http://blog.ippon.fr/wp-content/uploads/2014/06/gcm-notification-diagramme.png"><img class="alignnone  wp-image-10812" alt="gcm-notification-diagramme" src="http://blog.ippon.fr/wp-content/uploads/2014/06/gcm-notification-diagramme-300x203.png" width="305" height="205" /></a></p>
  <p>Via l’application Android, le terminal s’enregistre auprès du service “Google Cloud Messaging for Android”. Un numéro unique (registerId ou pushToken) est attribué et retourné au terminal. Ce dernier va ensuite le transmettre à l’application serveur afin qu’il soit sauvegardé. Lorsque l’application server voudra notifier l’utilisateur du terminal, elle enverra un message au GCM avec le “registerId” du terminal destinataire. GCM enverra une notification Push au terminal s’il est online. Dans le cas où le terminal est offline, la notification est stockée par GCM pour être délivrée à la prochaine mise en ligne. Côté terminal, notre application cliente traitera notre “notification Push”. Elle en fera une “notification Android” qui sera transmise à l’utilisateur par la barre des notifications.</p>
  <p>Simple non ? Il manque cependant une information dont je n’ai pas encore parlé. C’est le “Project Number” ou “senderId”.</p>
  <p>Le principe est le même qu’un envoi de courrier à une société. Si vous voulez que votre courier soit traité par le bon service il faut le préciser. Donc si le “registerId” de notre terminal est l’adresse de la société destinataire, le “Project Number”, ou “senderId”, est le nom du service qui traitera notre notification.</p>
  <h2>En pratique cela donne quoi ?</h2>
  <p>Il y a trois étapes pour gérer les notifications sous Android :</p>
  <ol><li>Créer un projet dans le “Google Developper Center” pour récupérer le “Project Number” (ou “senderId”). Spécifier pour ce projet l’utilisation du service “Google Cloud Messaging for Android”, et générer l’API Key.</li>
  <li>Créer l’application serveur qui va envoyer les notifications.</li>
  <li>Gérer la réception et le traitement des notifications dans l’application Android.</li>
  </ol><h2>Création du projet</h2>
  <p style="text-align: JUSTIFY;">Pour cela il vous faut un compte Google et vous rendre à l’adresse : <a href="https://cloud.google.com/console">https://cloud.google.com/console</a>. Ensuite il suffit d’effectuer les étapes suivantes :</p>
  <ol><li>Création du projet via le bouton “CREATE PROJECT” puis, lors du retour à la page principale, cliquez sur votre projet et vous aurez les “Project Id” et “Project Number”.</li>
  <li>Activation du service de notifications en allant dans “APIs &amp; Auth” &gt; “API”. Ajoutez ensuite le service “Google Cloud Messaging for Android”.</li>
  <li>Génération de l'”API Key” via le menu “APIs &amp; Auth” &gt; “Credentials”. Cliquez sur le bouton “Create New Key” de “Public API access”. Ensuite, générez une “Server key”. Vous pouvez laisser la zone de saisie des IPs vide, puis cliquez sur “Create”. Vous obtenez alors l'”API Key”.</li>
  </ol><h2>Création du serveur de notification</h2>
  <p>Pour utiliser l’API Google Cloud Messaging, il vous faut soit télécharcher gcm-server.jar <a href="http://www.java2s.com/Code/Jar/g/Downloadgcmserverjar.htm" title="Télécharger gcm-ser.jar">ici</a> et l’importer dans votre projet. Sinon, vous pouvez le référencer dans votre “pom.xml” avec les informations suivantes :</p>
  <div class="code-embed-wrapper"> <pre class="language-markup code-embed-pre"><code class="language-markup code-embed-code">&lt;repositories&gt;&#13;
    &lt;repository&gt;&#13;
      &lt;id&gt;gcm-server-repository&lt;/id&gt;&#13;
      &lt;url&gt;https://github.com/slorber/gcm-server-repository/raw/master/releases/&lt;/url&gt;&#13;
    &lt;/repository&gt;&#13;
  &lt;/repositories&gt;</code></pre> <div class="code-embed-infos">  </div> </div>
  <p>Nous souhaitons envoyer un message à un terminal donné. Partons du principe que nous avons un objet “MessageAEnvoyer” ayant pour attributs un identifiant (id), un titre, une date de création (dateMessage) et un texte. Nous allons créer notre message dans un premier temps. Dans notre code nous importons le package “com.google.android.gcm.server.Message“, puis nous créons notre objet :</p>
  <div class="code-embed-wrapper"> <pre class="language-java code-embed-pre"><code class="language-java code-embed-code">Message androidMessage = new Message.Builder()&#13;
  	.timeToLive(5)&#13;
  	.addData("id", messageAEnvoyer.getId())&#13;
  	.addData("titre", messageAEnvoyer.getTitre())&#13;
  	.addData("dateCreation", Long.toString(messageAEnvoyer.getDateMessage().getTime()))&#13;
  	.addData("texte", messageAEnvoyer.getTexte())&#13;
  	.build();</code></pre> <div class="code-embed-infos">  </div> </div>
  <p>N’oubliez pas que le message ne doit pas excéder 4 ko.</p>
  <p>Un message à destination d’un terminal peut contenir plusieurs informations :</p>
  <ul><li><em>collapse_key :</em> permet de regrouper les messages lorsque le terminal est hors ligne et ainsi de limiter les envois. Prendra pour valeur le nom du groupe (ex. : “New mail”, “Informations”).</li>
  <li><em>delay_while_idle :</em> indique que le message ne devra pas être envoyé immédiatement si le terminal est en veille. Lorsqu’il devient actif, c’est le dernier message “collapse_key” qui sera envoyé. Par défaut cette option est à “false”.</li>
  <li><em>time_to_live :</em> indique le temps, en secondes, durant lequel le message sera stocké sur le GCM storage. Par défaut la période de stockage est de 4 semaines.</li>
  <li><em>restricted_package_name :</em> permet d’envoyer le message uniquement aux terminaux dont le “register ID” est associé au package indiqué.</li>
  <li><em>dry_run :</em> permet lors du développement d’effectuer des envois sans réellement envoyer de message. Par défaut cette option est à “false”.</li>
  <li><em>data :</em> permet d’ajouter nos informations (payload) au message sous la forme “clé/valeur”. Les valeurs sont forcément de type “String”.</li>
  </ul><p>Maintenant que nous avons notre message, il nous suffit de l’envoyer. Pour cela nous allons utiliser une des méthodes de la classe “com.google.android.gcm.server.Sender“. Les méthodes disponibles sont :</p>
  <ul><li>MulticastResult <strong>send</strong>(Message message, List&lt;String&gt; registerIds, int retries) : permet d’envoyer une notification à plusieurs terminaux (au plus 1000). Le paramètre “retries” indique le nombre de tentatives en cas d’indisponibilité.</li>
  <li>Result <strong>send</strong>(Message message, String registerId, int retries) : permet d’envoyer un message à un terminal défini par son registerId. Le nombre de tentatives en cas d’indisponibilité est là aussi précisé.</li>
  <li>Result <strong>sendNoRetry</strong>(Message message, String registerId) : envoie un message à un terminal donné sans tentative si une indisponibilité est détectée.</li>
  <li>ResultMulticast <strong>sendNoRetry</strong>(Message message, List&lt;String&gt; registerIds) : envoie un message à une liste de terminaux sans effectuer d’autre tentative en cas d’indisponibilité.</li>
  </ul><p>La gestion des cas d’erreurs se fait grâce à la classe “com.google.android.gcm.server.Constants” qui contient les codes des erreurs présentes dans les objets “Result” et “MulticastResult”. Il est ainsi possible de savoir, par exemple, qu’un terminal n’a pas été notifié car l’application a été désinstallée. N’étant plus enregistré comme destinataire valide, il peut être retiré de la liste des contacts.</p>
  <p>L’envoi de notre message au GCM à destination d’un terminal, avec trois tentatives, se fera de la manière suivante :</p>
  <div class="code-embed-wrapper"> <pre class="language-java code-embed-pre"><code class="language-java code-embed-code">Sender sender = new Sender(apikey) // l'apikey qui a été générée précédemment&#13;
  &#13;
  Result resultat = sender.send(messageAndroid, regIdTerminal, 3);</code></pre> <div class="code-embed-infos">  </div> </div>
  <p>Une fois notre message envoyé au GCM, ce dernier l’envoie au terminal. Trois cas sont possibles :</p>
  <ol><li><em>Le terminal est connecté au réseau et actif :</em> la notification est envoyée instantanément.</li>
  <li><em>Le terminal est connecté au réseau mais inactif (mode IDLE) :</em> là, on joue avec les paramètres “delay_while_idle” et “collapse_key“. Si “delay_while_idle” est “false”, le message est délivré instantanément, sinon il est stocké. Dans ce cas, si le message est “collapsé”, si une nouvelle notification arrivait, elle remplacerait la notification stockée. Si le message est “non collapsé”, alors les nouvelles notifications sont stockées avec les anciennes dans la limite de 100 messages. A la réception du 101<sup>ème</sup> message, la file d’attente est remise à zéro.</li>
  <li><em>Le terminal n’est pas connecté au réseau :</em> les messages sont stockés par GCM et stockés dans la limites de 100 messages en fonction de la présence du “collapse_key“.</li>
  </ol><h2>Et côté client ?</h2>
  <p>Côté client, il y a deux choses à faire. La première est la partie permettant au terminal de s’enregistrer auprès du service “Google Cloud Messaging”. La seconde est le traitement de la notification.</p>
  <h3>Pré-requis à l’application Android</h3>
  <p>En pré-requis, il faut, dans le SDK Android, avoir :</p>
  <ol><li>Google Play Services</li>
  <li>Google APIs</li>
  <li>Le projet Google Play Services Lib en tant que dépendance Android</li>
  </ol><p>Ensuite il faut modifier le manifest de l’application afin d’y ajouter :</p>
  <ul><li>com.google.android.c2dm.permission.RECEIVE : permet à l’application d’enregistrer et recevoir des messages.</li>
  <li>android.permission.INTERNET : permet à l’application Android d’envoyer le registerId à l’application server.</li>
  <li>android.permission.GET_ACCOUNTS : autorise GCM à requérir un compte Google. Cette option est nécessaire uniquement sur les systèmes inférieurs à Android 4.0.4.</li>
  <li>android.permission.WAKE_LOCK : permet de laisser l’application en veille à la réception d’un message.</li>
  <li>votreApplicationPackage + “.permission.C2D_MESSAGE” : empêche les autres applications de s’enregistrer pour recevoir les messages de notre application.</li>
  <li>Un récepteur pour com.google.android.c2dm.intent.RECEIVE. Il devra avoir une permission “com.google.android.c2dm.SEND“, de sorte que seul GCM puisse lui envoyer un message. Si votre application utilise un “IntentService” ce récepteur doit être une instance de “WakefulBroadcastReceiver”.</li>
  <li>Un “Service” (en général un “IntentService”) auquel le “WakefulBroadcastReceiver” donnera le traitement du message, empêchant ainsi le terminal de se remettre en veille.</li>
  </ul><p>Votre “ApplicationManifest.xml” contiendra quelque chose du style :</p>
  <div class="code-embed-wrapper"> <pre class="language-markup code-embed-pre"><code class="language-markup code-embed-code">&lt;?xml version="1.0" encoding="utf-8"?&gt;&#13;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"  package="com.ippon.fr.android"&#13;
      android:versionCode="1"&#13;
      android:versionName="1.0" &gt;&#13;
      &lt;uses-permission android:name="android.permission.INTERNET" /&gt;&#13;
      &lt;uses-permission android:name="android.permission.GET_ACCOUNTS" /&gt;&#13;
      &lt;uses-permission android:name="android.permission.WAKE_LOCK" /&gt;&#13;
      &lt;permission  android:name="com.javapapers.android.permission.C2D_MESSAGE" android:protectionLevel="signature" /&gt;&#13;
  &#13;
      &lt;uses-permission android:name="com.ippon.fr.android.permission.C2D_MESSAGE" /&gt;&#13;
      &lt;uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" /&gt;&#13;
      &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /&gt;&#13;
      &lt;uses-permission android:name="android.permission.VIBRATE" /&gt;&#13;
  &#13;
      &lt;application ...&gt;&#13;
          &lt;receiver&#13;
              android:name=".GcmBroadcastReceiver"&#13;
              android:permission="com.google.android.c2dm.permission.SEND" &gt;&#13;
              &lt;intent-filter&gt;&#13;
                  &lt;action android:name="com.google.android.c2dm.intent.RECEIVE" /&gt;&#13;
                  &lt;action android:name="com.google.android.c2dm.intent.REGISTRATION" /&gt;&#13;
                  &lt;category android:name="com.ippon.fr.android" /&gt;&#13;
              &lt;/intent-filter&gt;&#13;
          &lt;/receiver&gt;&#13;
          &lt;service android:name=".GCMNotificationIntentService" /&gt;&#13;
      &lt;/application&gt;&#13;
  &lt;/manifest&gt;</code></pre> <div class="code-embed-infos">  </div> </div>
  <h3>Enregistrement du terminal</h3>
  <p>Commençons par enregistrer notre terminal auprès du GCM. On récupère une instance de la classe “com.google.android.gms.gcm.GoogleCloudMessaging” puis nous ferons appel à la méthode “register()”. Ce qui nous donne le code suivant :</p>
  <div class="code-embed-wrapper"> <pre class="language-java code-embed-pre"><code class="language-java code-embed-code">GoogleCloudMessaging gcm = GoogleCloudMessaging.getInstance(context); // context étant le context de l'activité&#13;
  String registerId = gcm.register(SENDER_ID);</code></pre> <div class="code-embed-infos">  </div> </div>
  <p>Le “senderId” ou “project number” est passé en paramètre de la méthode “register()” pour spécifier que le terminal s’enregistre au service GCM de notre projet. On récupère ainsi le “registerId” du terminal qu’il faudra transmettre à application server via un WebService par exemple.</p>
  <p>Résumé en deux lignes de code, cela semble simple. Dans la pratique, dans l'”Activity” faisant l’enregistrement du terminal, on vérifie la disponibilité des PlayServices. Si ces derniers sont actifs, alors on cherche à récupérer le “registerId” dans les SharedPreferences de l’application. S’il n’existe pas, l’enregistrement est effectué. Le contrôle de la version de l’application Android serait un plus. Il semblerait que GCM, lors de l’enregistrement du terminal, associe ce dernier à une version de l’application cliente. Du coup, lors d’un changement de version, le “register Id” du terminal ne serait plus valide.</p>
  <p>Voici un exemple de code d’Activity et de méthodes permettant de faire l’enregistrement auprès du GCM :</p>
  <div class="code-embed-wrapper"> <pre class="language-java code-embed-pre"><code class="language-java code-embed-code">public class GCMRegisterActivity extends Activity {&#13;
      GoogleCloudMessaging gcm;&#13;
      Context context;&#13;
      String regId;&#13;
      public static final String REG_ID = "regId";&#13;
      private static final String APP_VERSION = "appVersion";&#13;
  &#13;
      @Override&#13;
      public void onCreate(Bundle savedInstanceState) {&#13;
          super.onCreate(savedInstanceState);&#13;
          setContentView(R.layout.activity_register);&#13;
          context = getApplicationContext();&#13;
  &#13;
          [...]&#13;
          if (TextUtils.isEmpty(regId)) {&#13;
              // Récupération du registerId du terminal ou enregistrement de ce dernier&#13;
              regId = registerGCM();&#13;
              Log.d("GCM RegId: " + regId);&#13;
          } else {&#13;
              Toast.makeText(getApplicationContext(), "Déjà enregistré sur le GCM Server!", Toast.LENGTH_LONG).show();&#13;
          }&#13;
          [...]&#13;
      }&#13;
  &#13;
      /**************&#13;
       * Cette méthode récupère le registerId dans les SharedPreferences via&#13;
       * la méthode getRegistrationId(context). &#13;
       * S'il n'existe pas alors on enregistre le terminal via&#13;
       * la méthode registerInBackground()&#13;
       */&#13;
      public String registerGCM() {&#13;
          gcm = GoogleCloudMessaging.getInstance(this);&#13;
          regId = getRegistrationId(context);&#13;
  &#13;
          if (TextUtils.isEmpty(regId)) {&#13;
              registerInBackground();&#13;
              Log.d( "registerGCM - enregistrement auprès du GCM server OK - regId: " + regId);&#13;
          } else {&#13;
              Toast.makeText(getApplicationContext(), "RegId existe déjà. RegId: " + regId, Toast.LENGTH_LONG).show();&#13;
          }&#13;
          return regId;&#13;
      }&#13;
  &#13;
      private String getRegistrationId(Context context) {&#13;
          final SharedPreferences prefs = getSharedPreferences(&#13;
              MainActivity.class.getSimpleName(), Context.MODE_PRIVATE);&#13;
              String registrationId = prefs.getString(REG_ID, "");&#13;
          if (registrationId.isEmpty()) {&#13;
              Log.i(TAG, "registrationId non trouvé.");&#13;
              return "";&#13;
          }&#13;
         // On peut aussi ajouter un contrôle sur la version de l'application.&#13;
         // Lors d'un changement de version d'application le register Id du terminal ne sera plus valide.&#13;
         // Ainsi, s'il existe un registerId dans les SharedPreferences, mais que la version&#13;
         // de l'application a évolué alors on retourne un registrationId="" forçant ainsi&#13;
         // l'application à enregistrer de nouveau le terminal.&#13;
         return registrationId;&#13;
      }&#13;
  &#13;
      /**&#13;
       * Cette méthode permet l'enregistrement du terminal&#13;
       */&#13;
      private void registerInBackground() {&#13;
          new AsyncTask&lt;Void, Void, String&gt;() {&#13;
              @Override&#13;
              protected String doInBackground(Void... params) {&#13;
                  String msg = "";&#13;
                  try {&#13;
                      if (gcm == null) {&#13;
                          gcm = GoogleCloudMessaging.getInstance(context);&#13;
                      }&#13;
                      regId = gcm.register(PROJECT_NUMBER);&#13;
                      msg = "Terminal enregistré, register ID=" + regId;&#13;
                      // On enregistre le registerId dans les SharedPreferences&#13;
                      storeRegistrationId(context, regId);&#13;
                  } catch (IOException ex) {&#13;
                      msg = "Error :" + ex.getMessage();&#13;
                      Log.d("Error: " + msg);&#13;
                  }&#13;
                  return msg;&#13;
              }&#13;
          }.execute(null, null, null);&#13;
      }&#13;
   }</code></pre> <div class="code-embed-infos">  </div> </div>
  <p>Notre terminal étant enregistré, nous allons nous occuper du traitement de la notification. Lorsque l’application server envoie un message à un terminal, ce message n’est pas directement affiché dans la barre de notifications. Notre application Android doit récupérer le message, le traiter et générer une notification (dans l’univers Google, c’est une “Intent”) qui apparaîtra alors dans la barre de notification. Le message envoyé par l’application server est d’abord détecté par “WakefulBroadcastReceiver” qui le fera traiter par notre “IntentService”. Le traitement par l'”IntentService” n’est pas obligatoire et pourrait se faire via le “BroadcastReceiver”. Cependant, l’utilisation de l'”IntentService” s’est généralisée.</p>
  <p>Nous allons donc créer une classe “BroadcastReceiver” et une classe “GcmIntentService” qui hériteront des attributs et méthodes des classes “android.support.v4.content.WakefulBroadcastReceiver” et “android.app.IntentService“.</p>
  <p>Notre “BroadcastReceiver” :</p>
  <div class="code-embed-wrapper"> <pre class="language-java code-embed-pre"><code class="language-java code-embed-code">public class GcmBroadcastReceiver extends WakefulBroadcastReceiver {&#13;
  &#13;
      @Override&#13;
      public void onReceive(Context context, Intent intent) {&#13;
          ComponentName comp = new ComponentName(context.getPackageName(),&#13;
                  GCMNotificationIntentService.class.getName());&#13;
          startWakefulService(context, (intent.setComponent(comp)));&#13;
          setResultCode(Activity.RESULT_OK);&#13;
      }&#13;
  }</code></pre> <div class="code-embed-infos">  </div> </div>
  <p>Notre “GcmIntentService” :</p>
  <div class="code-embed-wrapper"> <pre class="language-java code-embed-pre"><code class="language-java code-embed-code">public class GcmIntentService extends IntentService {&#13;
      public static final int NOTIFICATION_ID = 1;&#13;
      private NotificationManager mNotificationManager;&#13;
      NotificationCompat.Builder builder;&#13;
  &#13;
      /*&#13;
       * Constantes permettant la récupération des informations&#13;
       * du message dans les extras de la notification envoyée&#13;
       * par le serveur de notification.&#13;
       */&#13;
      // Récupération de l'identification du message&#13;
      static final String MESSAGE_ID = "id";&#13;
      // Récupération du nom du message&#13;
      static final String MESSAGE_TITRE = "titre";&#13;
      // Récupération de la date et heure du message&#13;
      static final String MESSAGE_DATE_CREATION = "dateCreation";&#13;
      // Récupération du texte du message&#13;
      static final String MESSAGE_TEXTE = "texte";&#13;
  &#13;
      public GcmIntentService() {&#13;
          super("GcmIntentService");&#13;
      }&#13;
      public static final String TAG = "GCM Demo";&#13;
  &#13;
      @Override&#13;
      protected void onHandleIntent(Intent intent) {&#13;
          Bundle extras = intent.getExtras();&#13;
          GoogleCloudMessaging gcm = GoogleCloudMessaging.getInstance(this);&#13;
          // Le paramètre intent de la méthode getMessageType() est la notification push&#13;
          // reçue par le BroadcastReceiver.&#13;
          String messageType = gcm.getMessageType(intent);&#13;
  &#13;
          if (!extras.isEmpty()) {&#13;
              /*&#13;
               * On filtre le message (ou notification) sur son type.&#13;
               * On met de côté les messages d'erreur pour nous concentrer sur&#13;
               * le message de notre notification.&#13;
               */&#13;
              if (GoogleCloudMessaging.MESSAGE_TYPE_SEND_ERROR.equals(messageType)) {&#13;
                  sendNotification("Send error: " + extras.toString());&#13;
              } else if (GoogleCloudMessaging.MESSAGE_TYPE_DELETED.equals(messageType)) {&#13;
                  sendNotification("Deleted messages on server: " + extras.toString());&#13;
              // Si c'est un message "classique".&#13;
              } else if (GoogleCloudMessaging.MESSAGE_TYPE_MESSAGE.equals(messageType)) {&#13;
                  // Cette boucle représente le travail qui devra être effectué.&#13;
                  for (int i = 0; i &lt; 5; i++) {&#13;
                      Log.i(TAG, "Working... " + (i + 1)&#13;
                              + "/5 @ " + SystemClock.elapsedRealtime());&#13;
                      try {&#13;
                          Thread.sleep(5000);&#13;
                      } catch (InterruptedException e) {&#13;
                      }&#13;
                  }&#13;
                  Log.i(TAG, "Completed work @ " + SystemClock.elapsedRealtime());&#13;
                  // Traite les informations se trouvant dans l'extra de l'intent&#13;
                  // pour générer une notifiation android que l'on enverra.&#13;
                  sendMessageNotification(extras);&#13;
                  Log.i(TAG, "Received: " + extras.toString());&#13;
              }&#13;
          }&#13;
          // On indique à notre broadcastReceiver que nous avons fini le traitement.&#13;
          GcmBroadcastReceiver.completeWakefulIntent(intent);&#13;
      }&#13;
  &#13;
      /**&#13;
       * Cette méthode permet de créer une notification à partir&#13;
       * d'un message passé en paramètre.&#13;
       */&#13;
      private void sendNotification(String msg) {&#13;
          Log.d(TAG, "Preparing to send notification...: " + msg);&#13;
          mNotificationManager = (NotificationManager)&#13;
                  this.getSystemService(Context.NOTIFICATION_SERVICE);&#13;
  &#13;
          PendingIntent contentIntent = PendingIntent.getActivity(this, 0,&#13;
                  new Intent(this, LoggedActivity.class), 0);&#13;
  &#13;
          NotificationCompat.Builder mBuilder =&#13;
                  new NotificationCompat.Builder(this)&#13;
          .setSmallIcon(R.drawable.ic_stat_gcm)&#13;
          .setStyle(new NotificationCompat.BigTextStyle().bigText(msg))&#13;
          .setContentText(msg)&#13;
          .setDefaults(Notification.DEFAULT_ALL);&#13;
  &#13;
          mBuilder.setContentIntent(contentIntent);&#13;
          mNotificationManager.notify(NOTIFICATION_ID, mBuilder.build());&#13;
          Log.d(TAG, "Notification ID = " + NOTIFICATION_ID);&#13;
          Log.d(TAG, "Notification sent successfully.");&#13;
      }&#13;
  &#13;
      /**&#13;
       * Cette méthode permet à partir des informations envoyées par le serveur&#13;
       * de notification de créer le message et la notification à afficher sur&#13;
       * le terminal de l'utilisateur.&#13;
       *&#13;
       * @param extras les extras envoyés par le serveur de notification&#13;
       */&#13;
      private void sendMessageNotification(Bundle extras) {&#13;
          Log.d(TAG, "Preparing to send notification with message...: " + extras.toString());&#13;
          // On crée un objet Message à partir des informations récupérées dans &#13;
          // le flux JSON du message envoyé par l'application server&#13;
          Message msg = extractMessageFromExtra(extras);&#13;
          // On associe notre notification à une Activity. Ici c'est l'activity&#13;
          // qui affiche le message à l'utilisateur&#13;
          PendingIntent contentIntent = PendingIntent.getActivity(this, 0,&#13;
                  new Intent(this, MessageActivity_.class).putExtra(MessageActivity_.MESSAGE_ARG, msg), 0);&#13;
  &#13;
          // On récupère le gestionnaire de notification android&#13;
          mNotificationManager = (NotificationManager)&#13;
                  this.getSystemService(Context.NOTIFICATION_SERVICE);&#13;
  &#13;
          NotificationCompat.Builder mBuilder =&#13;
                  new NotificationCompat.Builder(this)&#13;
                          .setSmallIcon(R.drawable.ic_launcher)&#13;
                          .setContentTitle("Le nom de l'application par exemple")&#13;
                          .setStyle(new NotificationCompat.BigTextStyle().bigText(msg.getTexte()))&#13;
                          .setContentText(extras.getString(MESSAGE_TEXTE))&#13;
                          .setAutoCancel(true)&#13;
                          .setDefaults(Notification.DEFAULT_SOUND);&#13;
  &#13;
          mBuilder.setContentIntent(contentIntent);&#13;
          mNotificationManager.notify(NOTIFICATION_ID, mBuilder.build());&#13;
          Log.d(TAG, "Notification sent successfully.");&#13;
      }&#13;
  &#13;
      /**&#13;
       * Cette méthode permet d'extraire les informations du message de la notification&#13;
       * afin de créer un message.&#13;
       * @param extras l'objet contenant les informations du message.&#13;
       * @return le message&#13;
       */&#13;
      private Message extractMessageFromExtra(Bundle extras) {&#13;
          Message msg = null;&#13;
          if (extras != null) {&#13;
              msg = new Message();&#13;
              final String id = extras.getString(MESSAGE_ID);&#13;
              try {&#13;
                  msg.setId(Long.parseLong(id));&#13;
              } catch (NumberFormatException nfe) {&#13;
                  Log.e("error : le message n'a pas un identifiant valide. ",nfe.getMessage());&#13;
                  nfe.printStackTrace();&#13;
              }&#13;
              final String dateTime = extras.getString(MESSAGE_DATE_CREATION);&#13;
              try {&#13;
                  msg.setDateMessage(new Date(Long.parseLong(dateTime)));&#13;
              } catch (NumberFormatException nfe) {&#13;
                  Log.e("error : le message n'a pas une date valide. ",nfe.getMessage());&#13;
                  nfe.printStackTrace();&#13;
              }&#13;
              msg.setTitre(extras.getString(MESSAGE_TITRE));&#13;
              msg.setTexte(extras.getString(MESSAGE_TEXTE));&#13;
          }&#13;
          Log.d(TAG, "extractMessageFromExtra - fin");&#13;
          return msg;&#13;
      }&#13;
  &#13;
  }</code></pre> <div class="code-embed-infos">  </div> </div>
  <p>Lors de l’arrivée d’une “intent”, on récupère ses informations dans un objet “Bundle”. On regarde dans un premier temps si c’est un message d’erreur ou bien un message que nous pouvons traiter et afficher à l’utilisateur.</p>
  <p>Dans le cas du message d’erreur, l’utilisateur verra une notification portant le message d’erreur et le contenu du bundle.</p>
  <p>Si c’est un message à traiter, nous allons créer notre notification. Dans un premier temps, on extrait les données utiles grace à la méthode “extractMessageFromExtra”. Dans notre exemple, on crée un objet “Message” contenant un identifiant, un titre, une date de création et un texte. Ensuite, on va associer ce message à l’Activity qui aura la charge de l’afficher à l’utilisateur. Ainsi lorsque l’utilisateur tapera la notification, l’Activity sera lancée et affichera le message. Nous récupérons le gestionnaire de notification Android puis on crée la notre. Lors de la création de notre notification via “NotificationCompat.Builder”, il est possible d’ajouter des boutons d’actions, un son, faire vibrer le terminal, modifier l’icône, préciser que la notification doit disparaître après avoir été tapée, etc. Vous aurez la liste détaillée dans l’API Google <a href="http://developer.android.com/reference/android/support/v4/app/NotificationCompat.Builder.html" title="Notification Builder">ici</a>. Je vous conseille aussi cette <a href="http://developer.android.com/design/patterns/notifications.html" title="Affichage des notifications">page</a> qui vous montrera les possibilités d’affichage des notifications. Dans notre exemple nous faisons :</p>
  <ul><li><code>setSmallIcon</code> : pour remplacer l’icône,</li>
  <li><code>setContentTitle</code> : pour changer le titre de la notification afin que l’utilisateur sache quelle application la reçoit,</li>
  <li><code>setStyle(new NotificationCompat.BigTextStyle().bigText(...))</code> : pour pouvoir afficher un texte de grande longueur,</li>
  <li><code>setContentText</code> : pour afficher notre texte,</li>
  <li><code>setAutoCancel</code> : pour que la notification disparaisse une fois tapée,</li>
  <li><code>setDefaults(Notification.DEFAULT_SOUND)</code> : pour jouer le son par défaut du terminal lors de la réception.</li>
  </ul><h2>En conclusion</h2>
  <p>Le système de notification sous Android est assez simple à mettre en place. Il permet facilement d’alerter l’utilisateur de la disponibilité de nouvelles informations. La taille du payload fixée à 4 kilo-octets permet à l’application serveur d’envoyer des données à l’application cliente Android de manière simple. De plus, le fait de différencier la “notification Push” de la “notification Android” (cette dernière étant créée par l’application cliente Android) permet la transmission de données sans en avertir l’utilisateur.</p>
  <div id="socialButtonOnPage" class="leftSocialButtonOnPage"><div class="csbwfs-sbutton-post"><div id="fb-p" class="csbwfs-fb"><a href="javascript:" target="_blank" title="Share On Facebook"><i class="csbwfs_facebook"></i></a></div></div><div class="csbwfs-sbutton-post"><div id="tw-p" class="csbwfs-tw"><a href="javascript:" title="Share On Twitter"><i class="csbwfs_twitter"></i></a></div></div><div class="csbwfs-sbutton-post"><div id="gp-p" class="csbwfs-gp"><a href="javascript:" title="Share On Google Plus"><i class="csbwfs_plus"></i></a></div></div><div class="csbwfs-sbutton-post"><div id="li-p" class="csbwfs-li"><a href="javascript:" title="Share On Linkedin"><i class="csbwfs_linkedin"></i></a></div></div><div class="csbwfs-sbutton-post"><div id="pin-p" class="csbwfs-pin"><a href="denied:javascript:void(0);" title="Share On Pinterest"><i class="csbwfs_pinterest"></i></a></div></div><div class="csbwfs-sbutton-post"><div id="ml-p" class="csbwfs-ml"><a href="mailto:amsouber@ippon.fr" title="Contact us"><i class="csbwfs_mail"></i></a></div></div></div><div class="yarpp-related">
  <h3>Vous aimerez aussi</h3><ul><li><a href="https://blog.ippon.fr/2014/07/25/envoi-de-notifications-push-sur-terminaux-ios-avec-notnoopjava-apns/" rel="bookmark" title="Envoi de notifications Push sur terminaux iOS avec notnoop/java-apns">Envoi de notifications Push sur terminaux iOS avec notnoop/java-apns </a></li>
  <li><a href="https://blog.ippon.fr/2010/05/29/rencontre-gtug-le-4-juin-alleeeez/" rel="bookmark" title="Rencontre GTUG le 4 juin : Alleeeez !">Rencontre GTUG le 4 juin : Alleeeez ! </a></li>
  <li><a href="https://blog.ippon.fr/2014/09/26/android-wear-premiers-pas-pour-concevoir-et-designer-une-application/" rel="bookmark" title="Android Wear : premiers pas pour concevoir et designer une application">Android Wear : premiers pas pour concevoir et designer une application </a></li>
  <li><a href="https://blog.ippon.fr/2014/07/17/rex-lagilite-au-service-de-lequipe-et-du-projet-billet-4/" rel="bookmark" title="[REX] L’agilité au service de l’équipe et du projet – Billet #4">[REX] L’agilité au service de l’équipe et du projet – Billet #4 </a></li>
  </ul></div>
            </div>
          </div>


title: POC d’un suivi rassurant | Blog de l'EURL Barme
url: http://blog.barme.fr/2015/10/poc-dun-suivi-rassurant/
created_at: 2017-08-10 23:19:15
updated_at: 2017-08-10 23:19:15
mimetype: text/html
language: fr-FR
domain_name: blog.barme.fr
http_status: 200
content:
  <p>Lorsque l’on confie un colis à un transporteur, on souhaite naturellement savoir ce qu’il devient. Désormais, il y a toujours un suivi proposé d’emblée avec les différentes solutions d’expédition.</p>
  <p>Ce n’est pas toujours fiable. C’est parfois même annoncé.</p>
  <p><a href="http://blog.barme.fr/wp-content/uploads/2015/10/cavapasmarcher.png"><img class="aligncenter size-full wp-image-254" alt="cavapasmarcher" src="http://blog.barme.fr/wp-content/uploads/2015/10/cavapasmarcher.png" width="873" height="454" /></a>Et constaté.</p>
  <p><a href="http://blog.barme.fr/wp-content/uploads/2015/10/error.png"><img class="aligncenter size-full wp-image-259" alt="error" src="http://blog.barme.fr/wp-content/uploads/2015/10/error.png" width="410" height="111" /></a>En insistant, on finit quand même par avoir la confirmation que l’expédition est reconnue (pris en charge) ; ce qui constitue un renseignement à très faible valeur ajoutée.</p>
  <p><a href="http://blog.barme.fr/wp-content/uploads/2015/10/jamaisarrive.png"><img class="aligncenter size-full wp-image-255" alt="jamaisarrive" src="http://blog.barme.fr/wp-content/uploads/2015/10/jamaisarrive.png" width="580" height="306" /></a>En l’occurrence cela a fini par arriver mais pas encore à ce jour sur le suivi (cas authentique).</p>
  <h3>La solution apportée par les IoT</h3>
  <p>Les objets connectés apportent une solution à ce problème mais une balise géolocalisée par GPS doit avoir une bonne visibilité sur les satellites dont le calcul de sa position dépend. Ce qui est impossible à contrôler pour un colis.</p>
  <p>D’où l’idée de recourir au goody offert par OVH à l’occasion de son sommet… et la confirmation qu’un simple détecteur de mouvement et un capteur de température apportent un complément d’information très fiable et intéressant.</p>
  <p>Cette expérience à bénéficié d’un contexte d’expédition particulièrement favorable : 5 jours de Lille à Lyon !</p>
  <p>Le suivi officiel est particulièrement anxiogène :</p>
  <p><a href="http://blog.barme.fr/wp-content/uploads/2015/10/suiviofficiel.png"><img class="aligncenter size-full wp-image-253" alt="suiviofficiel" src="http://blog.barme.fr/wp-content/uploads/2015/10/suiviofficiel.png" width="570" height="1011" /></a>Tandis que <strong>les informations fournies par le Sens’It d’Axible transmises par le réseau Sigfox et lues sur l’IoT PaaS TimeSeries offerte par OVH sont d’une fiabilité et d’une précision exemplaires. </strong>Même soumis aux contraintes de manipulations aléatoire et dans un environnement incontrôlable, la balise à toujours réussi à émettre et son signal toujours été capté !</p>
  <p><a href="http://blog.barme.fr/wp-content/uploads/2015/10/suiviprecis.png"><img class="aligncenter size-full wp-image-257" alt="suiviprecis" src="http://blog.barme.fr/wp-content/uploads/2015/10/suiviprecis.png" width="1104" height="600" /></a>La courbe en rouge est le retour du capteur de mouvement, celle en noir correspond à la température.</p>
  <p>On comprend clairement que le colis, expédié le matin du vendredi 16/10/15 est arrivé à Lyon le 17/10/15 vers 12:00 où il a stagné tout le dimanche dans un endroit non chauffé puisque sa température est descendue jusqu’à 8.5 ºC ! On imagine qu’il est peu recommandé d’expédier des denrées sensibles aux fortes variations de température ; du chocolat en été par exemple.</p>
  <p>Tandis que le suivi officiel dispense des nouvelles rares et alarmantes, “<i>Votre colis ne peut actuellement être livré à son destinataire, l’adresse de livraison étant incomplète.</i>” les retours du capteur permettent de savoir, avec une mise à jour toutes les 10 minutes, que le colis subsiste à une température compatible avec la préservation de son contenu et surtout qu’il bouge toujours.</p>
  <p>Le top de l’expérience est quand le destinataire fait un double clic sur le bouton du goody d’OVH qui envoie automatiquement un mail à l’expéditeur.</p>
  <p><a href="http://blog.barme.fr/wp-content/uploads/2015/10/colisrecu.png"><img class="aligncenter size-full wp-image-256" alt="colisrecu" src="http://blog.barme.fr/wp-content/uploads/2015/10/colisrecu.png" width="266" height="98" /></a>Que du bonheur.</p>


title: What is a blockchain?
url: https://www.blockstars.io/blog/2015/02/what-is-a-blockchain/
created_at: 2017-08-10 23:19:17
updated_at: 2017-08-10 23:19:17
mimetype: text/html
domain_name: www.blockstars.io
preview_picture: https://www.blockstars.io/wp-content/uploads/2015/02/What-are.jpg
http_status: 200
content:
  <p class="title">WHAT IS A BLOCKCHAIN?</p>
  						<div class="image">
  							<img width="825" height="510" src="https://www.blockstars.io/wp-content/uploads/2015/02/What-are-825x510.jpg" class="attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="" /></div>
  						<p>Most people get bogged down in what is the best and most exact definition of a ‘block chain’. The technical definition is as described here on Wikipedia; <a href="https://en.wikipedia.org/wiki/Bitcoin#The_block_chain">‘a distributed database that serves as a public ledger’</a>. But that’s not very useful to general public. I think it’s much more valuable to focus on what they can do and, in a jargon free way, how they function. This allows people to connect the dots themselves and apply the possibilities to their own worlds.</p>
  <p>In my mind they comprise of 8 constituent parts, detailed below and explained in context throughout the following post:<br /><strong>– Tokens</strong></p>
  <p><strong>– Electronic Transactions</strong></p>
  <p><strong>– Processing Hardware</strong></p>
  <p><strong>– Wallets</strong></p>
  <p><strong>– Marketplaces</strong></p>
  <p><strong>– Governing Bodies</strong></p>
  <p><strong>– Exchanges</strong></p>
  <p><strong>– Applications</strong></p>

  <p>Blockchains allow for the decentralisation and atomisation of tasks between two transacting entities, whilst removing human subjectivity and error from the process.</p>
  <p>Transactions can be the transfer of digital tokens for their own sake, transfer of ownership of tokens associated to other values (such as services and physical or digital assets), as well as contractual agreements.</p>

  <p>This allows such transactions to take place, with a lower degree of required trust between all participants, as long as they trust the integrity of the system as a whole, and at a much lower cost.</p>

  <p>Blockchains generally, as open source software,  are being continually refined. In theory this means that any problems can be ironed out over time, with the addition of an innumerable number of blockchains, custom built to serve any given niche.</p>

  <p>Blockchains serve as the platform to a system of dedicated app’s, known as decentralised applications. So named because they function with varying degrees of automation and independence from administrators. Beyond the applications creation, human effort may typically only be required to ensure that they comply with rules, as well as their general administration or refinement. These rules can be complex, real world, regulatory laws or just basic programming rules. Additionally, the applications can interact with their counterparts solely on a single blockchain, other blockchains or with real world API’s.</p>

  <p>Broadly speaking the roles of people, involved in the lives of these applications, are based on creation, configuration, optimisation and governance. But in theory, a perfect decentralised application could live and work <a href="https://bitcoinmagazine.com/7050/bootstrapping-a-decentralized-autonomous-corporation-part-i/">entirely autonomously</a> on a blockchain.</p>

  <p>These ‘Decentralised Applications’ are unusual in their business models, because in principle, they distribute their costs to a 3rd party processing network, which then acts as a transactions marketplace. This means that blockchain based businesses, in theory, should not have the up front and central costs typical of technology start-ups in order to pre-empt scaling. It’s costs are served by the processing network on a pay-as-you-go basis and processing is prioritised based on an effort vs. reward equation by the system. This is obviously in direct conflict with <a href="http://en.wikipedia.org/wiki/Net_neutrality">Net Neutrality</a>, in as much as how the existing Internet bandwidth is evenly distributed.</p>

  <p>However it does remove duplications of tasks and resources that are typically seen in a centralised market. In theory the processing can be done by anyone with the appropriate hardware, and in the case of the bitcoin blockchain, an increasing amount of centralisation has taken place in the form of processing farms that leverage economies of scale.</p>

  <p>Transactions; which can include the resolution of a contract or the transfer of an asset, are processed by these 3rd parties in a semi-anonymous and automated fashion. This removes the ability or motivation for processors to corrupt the process. Both because transactions are anonymous but also because they’re recorded on a public ledger that can be accessed, at any time, by the entire ecosystem. The rules of this transaction are hard-coded at creation and are, in theory, incorruptible.</p>

  <p>Tokens of value, the most commonly used being Bitcoin, power the ecosystem. The system uses wallets to store tokens to pay for application powered services and in turn, they use the same tokens to pay processors for fulfilling transactions.</p>

  <p>Tokens are moved on and off blockchains via, increasingly regulated, exchanges whilst their value is converted into fiat currency at a given exchange rate on that particular day. The volatility of this exchange rate, is the single greatest concern for all stakeholders in any blockchain ecosystem and this is a key barrier to their wider adoption. Large daily movements, in relationships between tokens like Bitcoin and fiat currencies, make it impossible to know for sure how the reward for participating in a blockchain, measures against the real-world cost of doing so. The most important concern, rests with the processing network who must invest real world, fixed costs to fulfil their transactions.</p>
  						<p>
  							Tags: <a href="https://www.blockstars.io/blog/tag/blockchain/" rel="tag">blockchain</a>, <a href="https://www.blockstars.io/blog/tag/how/" rel="tag">how</a>, <a href="https://www.blockstars.io/blog/tag/what-is/" rel="tag">what is</a><br /></p>
  						


title: SATOSHI'S REVOLUTION: How The Creator Of Bitcoin May Have Stumbled Onto Something Much, Much Bigger
url: http://uk.businessinsider.com/the-future-of-the-blockchain-2014-4?r=US&IR=T
created_at: 2017-08-10 23:19:18
updated_at: 2017-08-10 23:19:18
mimetype: text/html
language: en
domain_name: uk.businessinsider.com
http_status: 200
content:
  <div class="KonaFilter image-container display-table"><div><div class="image"><img src="http://d3j5vwomefv46c.cloudfront.net/photos/large/849526553.gif?1398172091" alt="" style="border: 0px;" /></div><div class="perfect-market article-ad-image">
  </div></div>&#13;
  <p>We gave our <a href="http://www.businessinsider.com/satoshi-nakamoto-person-of-the-year-2013-12">Person of the Year award</a> for 2013 to Satoshi Nakamoto, the pseudonymous creator of Bitcoin. We know some of you laughed. </p>&#13;
  <p>If you did, you may want to read on. It's becoming increasingly clear that Satoshi's creation has the potential to change how much of commerce itself works, and for reasons not even many Bitcoin fans realize.</p>&#13;
  <p>By many accounts, Satoshi came up with a real-world solution to a longstanding computer science paradox known as the double-spend problem, or the <strong>Byzantine General's problem</strong> (<a href="http://research.microsoft.com/en-us/um/people/lamport/pubs/pubs.html#byz">the professor who named it explains why he did so here</a>). The challenge is how to send and receive money online without the need for a trusted third party, such as PayPal, ensuring that the same digital credit standing in for the amount being exchanged isn't being spent twice. </p>&#13;
  <p>In the real world, this problem gets avoided with cash, which is quite difficult to counterfeit. In practice, digital counterfeiting is much easier. </p>&#13;
  <p>Satoshi's solution was what has become known as the blockchain: a ledger of all transactions owned and monitored by everyone but ultimately controlled by none. It's like a giant interactive spreadsheet everyone has access to and updates to confirm each digital credit is unique. </p>&#13;
  <p>It is this technology that programmers are now working to deploy for uses that go far beyond Bitcoin. Satoshi does not appear to have been looking to solve this problem when he created Bitcoin. But his design for the blockchain, <a href="https://bitcoin.org/bitcoin.pdf">which he spelled out in his 2008 Bitcoin spec paper</a> (PDF), has profound implications.</p>&#13;
  <p>"For the first time, two people can exchange a piece of digital property, without any prior relationship, and in a secure way, over the Internet," Jeff Garzik, one of Bitcoin's core developers (now employed by payment processor BitPay) told Business Insider. "As a computer scientist, and in computer science in general, when you talked about building distributed systems, there tended to be a purely theoretical view about how computers would talk to each other, how to keep them coordinated. Satoshi and the blockchain really solved that problem in an elegant and unexpected way.</p>&#13;
  <blockquote class="pullquote"><div>I don't think the computer science community has really caught up yet.</div></blockquote>&#13;
  <p>"I don't think the computer science community has really caught up yet," Garzik said.</p>&#13;
  <p>The breakthrough means that, theoretically, any act of commerce on the Web can be decentralized and stripped of a controlling authority. </p>&#13;
  <p>Perhaps the most straightforward example of a post-Bitcoin service using Satoshi's blockchain is <a href="http://www.proofofexistence.com">Proof of Existence</a>. Created by Manuel Araoz, a 25-year-old developer in Argentina, the site allows you to upload a file to certify that you had custody of it at a given time. Neither its contents nor your own personal information are ever revealed — rather, all the data in the document gets digested into an encrypted number. Proof of Existence is built on top of the Bitcoin blockchain (there's a 0.005 BTC fee), so <a href="https://getaddr.bitnodes.io/">the thousands of computers on that network</a> have now collectively verified your file.</p>&#13;
  <p><img src="http://static3.uk.businessinsider.com/image/54ef666edd089504138b4680-959-642/screen%20shot%202014-04-16%20at%207.30.45%20pm.png" alt="proof of existence" width="800" style="border: 0px;" />Proof Of Existence</p><p>&#13;
  </p><p>A slightly more politicized application of the blockchain is a project called <a href="https://www.namecoin.org/">Namecoin</a>. </p>&#13;
  <p>Currently, the international nonprofit ICANN governs nearly all top-level Web address domains such as ".com." </p>&#13;
  <p>But three years ago, engineers developed Namecoin, which serves as a new domain-name system for registering Web addresses that end in ".bit." In this case, instead of ICANN controlling the domain name system, you and all the other people in the Namecoin system control the domain names. </p>&#13;
  <p>Again, blockchain technology makes it so that something that previously required a centralized authority can now be managed via community. </p>&#13;
  <p>At this point, payment processors like Western Union probably have the most to fear from blockchain competition, according to Gil Luria, a managing director at Wedbush Securities covering financial technology. You may have heard this before, but Luria explained why the blockchain is the true threat: Most processors use hub-and-spoke models, he said, which are able to charge fees for crossing jurisdictions, and for smaller transaction amounts. Decentralizing and distributing the network gets rid of all that.</p>&#13;
  <p>"It’s a much more competitive business model," Luria told us by phone. "Instead of paying 5% to 10% in fees to Western Union, you're going to be 2% to 3%, possibly even less.</p>&#13;
  <p><img src="http://static1.uk.businessinsider.com/image/54ef666edd089504138b4681-800-628/screen%20shot%202014-04-17%20at%204.04.47%20pm-2.png" alt="bitcoin vs payment processors" width="800" style="border: 0px;" />Rob Wile/Paul Baran</p><p>&#13;
  </p><p>A startup called Ripple represents the most active threat to the mega-processors. (<a href="http://www.businessinsider.com/ripple-profile-2014-3">We profiled Ripple, and the group that created it, last month</a>.) Computers all familiar with each other on Ripple's network mutually agree on changes to its blockchain (Ripple calls it a "ledger"). This allows transactions to be processed instantly and without a third party. It's even faster than the Bitcoin network, because everyone using the Ripple ledger gets their own copy of the whole ledger, in contrast with the nodes on the Bitcoin network all sharing a single one. </p>&#13;
  <p>The blockchain is even stalking credit-card companies. In an interview in <a href="http://www.businessinsider.com/goldman-completely-debunks-all-the-arguments-for-bitcoin-2014-3">Goldman Sachs' note on Bitcoin last March</a>, Fred Ehrsam, the CEO of mega-Bitcoin payment processor Coinbase, observed that a Bitcoin-like payment network would solve the problem of having your credit-card info stored with a big-box retailer like Target. Even sending money through Venmo, the app that lets you text your friends for picking up dinner that one time, still takes five days to clear.</p>&#13;
  <p>Of course, it's possible the existing financial behemoths could adopt their own blockchain technologies. In the same Goldman note, Goldman information technology services analyst Roman Leal writes that, "just as a flurry of new entrants — such as Square, Groupon, and PayPal — encouraged payment networks and payment processors to develop a mobile payments strategy, we expect traditional payment players to develop digital currency strategies." </p>&#13;
  <p>Two groups, BitShares and Ethereum, are hoping to blockchain-ify ... everything. BitShares founder and CEO Daniel Larimer has his eye on <a href="http://bitshares.org/exchange/">stock exchanges</a>, <a href="http://bitshares.org/voting/">voting</a>, <a href="http://bitshares.org/music/">music distribution</a>, and so on. He calls such futuristic entities distributed autonomous corporations. To use the music example, Larimer envisions artists having the ability to issue shares in their own songs, encouraging fans to spread the tune far and wide to increase returns. </p>&#13;
  <p>"We give power to shareholders without centralizing in any way, because we’ve eliminated the barriers to entry for starting a company," Larimer told us at the recent Inside Bitcoins conference. (Incidentally, he said having a conference called Inside Bitcoins was akin to having a conference called Inside AltaVista.) </p>&#13;
  <p>There are, of course, loads of technological and regulatory hurdles that must still be overcome for all of this to materialize. And there are plenty of things that could be reset on a blockchain. But investors don't seem too concerned: Marc Andreessen (who invests in Business Insider) and Fred Wilson are betting big in this space.</p>&#13;
  <blockquote class="pullquote float_right"><div>Our 2014 fund will be built during the blockchain cycle. — Fred Wilson  </div></blockquote>&#13;
  <p>In a recent blog post, Wilson <a href="http://avc.com/2014/04/the-mobile-downturn/">equated</a> the breakthrough blockchain represents to the Web browser and social media. He refers to this moment as the blockchain cycle:</p>&#13;
  <p>Our 2004 fund was built during social. Our 2008 fund was built during social and the emergence of mobile. Our 2012 fund was built during the mobile downturn. And our 2014 fund will be built during the blockchain cycle. I am looking forward to it.</p>&#13;
  <p>"I think we see every week now somewhere between one and three entrepreneurs come in with blockchain ideas," Andreessen Horowitz's Chris Dixon told Business Insider. "There's definitely some momentum behind it."</p>&#13;
  <p>We'll leave you with an extremely futuristic example of how the blockchain could be deployed. </p>&#13;
  <p><a href="https://www.youtube.com/watch?v=Pu4PAMFPo5Y&amp;feature=youtu.be">In a talk given last fall at the Turing festival</a>, Mike Hearn, a former Google employee who quit his job to work full-time on Bitcoin, laid out this scenario: A 20-something Scottish girl named Jen wants to meet up with her friends downtown. She doesn't own a car — no one does in the future — so she dials up a cab through a network Hearn calls TradeNet.  </p>&#13;
  <p><img src="http://static2.uk.businessinsider.com/image/54ef666ddd089504138b467f-175-339/screen%20shot%202014-04-14%20at%208.04.07%20am.png" alt="mike hearn" style="border: 0px;" />Mike Hearn at the Turing Festival.<a href="https://www.youtube.com/watch?v=Pu4PAMFPo5Y&amp;feature=youtu.be">Youtube</a></p><p>Jen's request acts as a request-for-bid on TradeNet, and all the robot cabs available start automatically posting offers, like on an exchange. Jen's node then ranks the bids and presents them to Jen based on criteria including price but also things like whether she's used that cab before and what other people have said about it. All of this is done on a distributed blockchain system, so no centralized taxi company needs to manage the orders.</p>&#13;
  <p>The blockchain, by the way, will have improved that recommendation process, Hearn says. Currently, many recommendation systems at places like Yelp or Seamless say they use your social network to help you choose services. In practice, they end up producing what amounts to spam reviews, since it's unlikely a friend you trust will have reviewed the same service you're looking into. Hearn says cryptography — without which Bitcoin couldn't exist — has helped reduce spam by providing more authoritative, useful authentication.</p>&#13;
  <p>In this future scenario, the roads on which Jen is driving will have also become autonomous actors, doing trades with the car on TradeNet. They can submit bids to the car about how much they're going to charge to use them. If she's in a hurry, Jen can choose a road that's a bit more expensive but which will allow her to get into the city faster.  </p>&#13;
  <p>Awesome, right? </p>&#13;
  <p>"This is possible because of Bitcoin," Hearn says. "Bitcoin has no intermediaries, therefore there's really nothing to stop a computer from just connecting to the Internet and taking part all by itself. All you need to do to instantiate a Bitcoin wallet is generate a large random number."  </p>&#13;
  <p>Hearn gives other examples of where the TradeNet could be deployed, like buying fruit and vegetables, or units of computation time if you're buying clouds services. Any transactions that are fast, lightweight, and commoditized — which the current system Hearn says is bad at — could be done so much better on the Blockchain.</p>&#13;
  <p>The entirety of Hearn's talk is pretty amazing, <a href="https://www.youtube.com/watch?v=Pu4PAMFPo5Y&amp;feature=youtu.be">and we recommend you watch it</a>.</p>&#13;
  <p>With a handful of exceptions, like Proof of Existence, it's too early to see fully functional applications of blockchain technology. Ripple, for instance, is still courting financial institutions that would benefit from using its payment rail. Bitcoin's main developers are <a href="http://letstalkbitcoin.com/blockchain-2-0-let-a-thousand-chains-blossom/#.U0vVC-Zg6Go">still figuring out ways to tweak its protocol without bringing down the entire network</a>. And of course there remain a host of outstanding regulatory issues that will need to get sorted out before massive expansion of these proposed services can occur.</p>&#13;
  <p>The blockchain helps end the debate about what Bitcoin is. There's been discussion about whether Bitcoin is a currency, a commodity, or a technological protocol. There are good arguments for each categorization, but each is unsatisfying in some way.</p>&#13;
  <p>Now we know why this debate is so unsatisfying. Bitcoin represents a novel form of organization — a blockchain-based entity — that's not quite like anything seen before it.</p>&#13;
  <h3>
  <br /><strong>NOW WATCH: The Creator Of One Of The World's Biggest And Most Powerful Websites Is Not Rich</strong>
  </h3>&#13;
  <div id="ooyalaplayer">&#13;
  <noscript><div>&amp;lt;div&amp;gt;Please enable Javascript to watch this video&amp;lt;/div&amp;gt;</div></noscript>&#13;

              <p class="tagline">Get the latest Bitcoin price<a href="http://markets.businessinsider.com/currencies/BTC-USD"> here.</a></p>                                                                                        
       <div class="margin-top popular-video">
          <h3>NOW WATCH: <a href="http://uk.businessinsider.com/nationwide-insurance-industry-loss-ratio-2015-2">Nationwide's Super Bowl commercial about dead children is about corporate profits ... in a way that we can all appreciate</a></h3>
              
                  <div id="video-popular">
                  </div>
      </div></div></div>

preview_picture:
  http://static2.uk.businessinsider.com/image/54ef6674dd089504138b4683-1190-625/satoshis-revolution-how-the-creator-of-bitcoin-may-have-stumbled-onto-something-much-much-bigger.jpg


title: blockchain | Bitcoin Theory
url: https://btctheory.com/tag/blockchain/
created_at: 2017-08-10 23:19:21
updated_at: 2017-08-10 23:19:21
mimetype: text/html
language: en
domain_name: btctheory.com
http_status: 200
content:
  <div class="entry-content">
  		<p><img class="alignright size-medium wp-image-3597" src="https://btctheory.files.wordpress.com/2016/12/screen-shot-2016-12-11-at-11-31-30-am.png?w=300&amp;h=238" alt="trojan horse" width="300" height="238" />Bitcoin is the trojan horse of the fiat monetary system and will ultimately end the state’s control of money. However this process will also compromise bitcoin’s core principals and cause for the corruption of bitcoin’s pseudonymous traits. Over the next decade as the cryptoeconomy expands its reach to become truly global, the financial system will quake as its foundation shifts from state fiat money, to decentralized digital currencies. While we should celebrate the rise of digital currencies, the full collapse of governments and global financial system is unlikely.</p>
  <p>What we will see instead will be the horrifying metamorphosis of bitcoin into a panoptic nightmare. Bitcoin will be used by governments, bankers, and regulators to track our every purchase, and monitor all financial activity. <a href="http://bitcoin.stackexchange.com/questions/7966/what-are-tainted-coins-exactly">Tainting tools</a> will become so powerful that pretty much any bitcoin transaction will be possible to de-anonymize.</p>
  <p>The crisis of fiat money will change not only finance and banking for the better, but the nature of governance as we know it. Bitcoin is going to be a trojan horse to the fiat banking system, and will destroy all government monopolies on this issuance of money. While bitcoin will be able to act as a check on the economic power of governments, in doing so it is also going to expose bitcoin to rigorous state regulations, and ultimately the full capturing of bitcoin as a whole system. Bitcoin may end the state’s control of money, but it may also open the path to the state’s ability to watch all financial transactions.</p>
  <h3>Inverting Bitcoin</h3>
  <div id="attachment_3599" class="wp-caption alignleft"><img class="wp-image-3599 size-medium" src="https://btctheory.files.wordpress.com/2016/12/screen-shot-2016-12-11-at-11-36-39-am.png?w=300&amp;h=243" alt="Blythe Masters" width="300" height="243" /><p class="wp-caption-text">Blythe Masters</p></div>
  <p>This video at <a href="https://www.youtube.com/watch?v=ZiMl2b5O7Ho&amp;feature=youtu.be&amp;t=3h54m54s">the Bank of England with Blythe Masters</a> she speaks about what she believes to be in store for the future of bitcoin. She openly admit that the state supports her project, and that, “There will be no currency that gets around government controls.” Later the host of the program states, “There is no innovation that governments cannot seize for their own advantage…” This is followed by a discussion of the panopticon effect that bitcoin can have through tainting bitcoins and tracking their movements. All of this seems to be eluding to the capturing of bitcoin–banks and governments are working together to ‘inverting’ the blockchain to monitor all transactions.</p>
  <h3>Capturing Bitcoin</h3>
  <p>To capture bitcoin, all that governments need to do is auction off the bitcoin payment system to be regulated under the threat of force. This is already happening and companies like Coinalytics and Elliptic and providing the tools to taint and track bitcoins coming from anywhere. Effectively, this make every bitcoin highly traceable, which in turn can allow the banking system to merge with bitcoin to create a financial panopticon.</p>
  <p><img class="aligncenter size-full wp-image-3600" src="https://btctheory.files.wordpress.com/2016/12/screen-shot-2016-12-11-at-11-38-07-am.png?w=1008" alt="bitcoin-tainting" />This new global monetary system where bitcoin will act as the rails of the financial system is magnitudes more efficient than all current fiat systems. This will create a <a href="https://btctheory.com/2013/10/21/transaction-cost-bitcoin/" target="_blank">lower general transaction cost</a> when compared to any fiat money today, and will be the foothold that digital currencies will take to win out economically over fiat money in the long run. This is the inversion of bitcoin and will be how bitcoin will finally ‘die’ because of state compromise.</p>
  <p>However, this is only the death of bitcoin’s body, not its soul.</p>
  <p>Death by state and bank compromise will create the conditions for bitcoin’s core mission to be achieved through it becoming a trojan horse within their own system. This will cause for the destruction of fiat money, and will reassert the power of the purse back into the hands of the people.</p>
  <p>There is no way that banks and financial service companies will be able to use ‘the blockchain’ (i.e. bitcoin) without also causing two other actions to happen simultaneously:</p>
  <ol><li>The legitimization of bitcoin and other digital currencies as a global money.</li>
  <li>Exposing the legacy financial system to speculative attacks from the cryptocurrency economy, ultimately leading to a devaluation of fiat money against bitcoin and other cryptocurrencies as fiat money is displaced.</li>
  </ol><h3>Capturing the State</h3>
  <p>If bitcoin becomes a global reserve currency, as the <a href="http://www.coindesk.com/barbados-central-bank/" target="_blank">central bank of Barbados believes it could be</a>, then bitcoin is forging a path towards capturing the state through the very means by which it has captured all of us: through economic means.</p>
  <p><img class="alignright wp-image-3602" src="https://btctheory.files.wordpress.com/2016/12/screenshot-2016-12-12-at-12-00-55-pm.png?w=316&amp;h=422" alt="resist" width="316" height="422" />Bitcoin has some flaws in regards to its privacy that should scare off neer-do-wellers and privacy advocates alike. However, these same aspects are what makes bitcoin very, very appealing to the financial world, and is the reason they will start using bitcoin as their base currency under the mantra of ‘blockchain’. The transparent nature of the blockchain offers the possibility of a totally regulated and systematized world of digital currencies that is a statist wet-dream. However, through implementing such a system, states will also lose control of their choke hold on the economy, and will eventually find it slipping through their grip entirely. The fundamental truth is that <strong>Bitcoin and other cryptocurrencies are better money than <em>ANY </em>form of money that we have ever seen! </strong>This is by virtue of that cryptocurrencies are <em>not </em>state-controlled, and cannot be state-controlled. It is plain and simple economics at the end of the day which is going to cause for bitcoin and other digital currencies to win out over fiat money.</p>
  <p>Bitcoin has created a whole new generation of crypto-activist who see the power of digital currencies and cryptography in a way that will allow for a new fundamental form of power to exercise itself. The trojan horse is not bitcoin itself, but to see the possibility of real economic independence outside and beyond the control of the state which bitcoin enables. There is no longer any separation between politics and economics, and that is the very space in which we will make the new digital economy, and ensure our liberties through strong crypto.</p>
  <p>Through refusing to use their corrupt money that they use for war, oppression, violence, and to keep the general population impoverished; we can force governments everywhere to respect our freedoms which our ancestors fought and died for. The state was never suppose to have economic sovereignty over us, and it is now time for us to reclaim that sacred right, and ensure it can never be taken away again. <a href="https://btctheory.com/2014/05/16/capital-exit-capital-strike/">Strike against state capitalism</a>, and reclaim your financial freedom which was never suppose to be taken in the first place!</p>
  			</div><div class="entry-content">
  		<p><img class="alignleft size-medium" src="https://upload.wikimedia.org/wikipedia/commons/4/40/I_Love_Bitcoin_Icon_256_x_256.png" alt="Bitcoin" width="256" height="256" />Bitcoin and alternative digital currencies (altcoins) are much more that just simple currencies–they are a means of exchange, and the entry point into the new digital economy: the cryptoeconomy. Their development represents a technological protocol for digital ownership and economic exchange. This has far reaching ramification for both the internet and money as they both evolve to create their own new economic machine totally removed from state command economies and monetary systems.</p>
  <p>With digital currencies acting as a new sovereign monetary force, they are facilitating the growth of a radical new sector of the digital economy that is total unregulated, and removed from the onerous regulations of all state governments. This is allowing for a proliferation of specialized ‘altcoins’ which range from useless to spectacular, each which seeks to create their own specialization within this new digital economy. While many are duds and even outright scams, there is a whole new economy being built, and many of the ideas are both huge in scope, and with the impact they want to create.</p>
  <h3>Specialization, Money, and Transaction Cost</h3>
  <div id="attachment_3404" class="wp-caption alignright"><img class="wp-image-3404 size-medium" src="https://btctheory.files.wordpress.com/2016/10/screenshot-2016-10-12-at-10-32-17-am.png?w=300&amp;h=174" alt="smith ricardo" width="300" height="174" /><p class="wp-caption-text">Adam Smith and David Ricardo</p></div>
  <p>Adam Smith first presented the idea of specialization in Wealth of Nations. David Ricardo later expanded on this idea with his theory of comparative advantage, which is the idea that that nations should specialize in industrial production that they have distinct advantages in. Digital currencies can specialize in the same way, creating their own comparative advantage by working directly within the framework of the internet, rather then limiting themselves with anachronistic limits of state forms of money, and their laws. This, in turn, radicalizes not just money and finance, but anything to do with the internet and economics.</p>
  <p>One of the most important economic features of bitcoin and other digital currencies is the <a href="https://btctheory.com/2013/10/21/transaction-cost-bitcoin/">near-zero transaction cost</a> they have, which means that in almost all cases over an extended timetable, <em>digital currencies will <strong>always </strong>have a lower systemic transaction cost than any form of fiat money. </em>Thus, using bitcoin as a mode of exchange to invest in new and exciting technologies not only is quicker, cheaper, and more secure (when using appropriate security protocols!) than in the fiat economy, but also opens up a whole new world of investing opportunity that could not exist otherwise.</p>
  <p>With digital currencies being native to the internet, unlike fiat money, they are empowered to create a totally new kind of economy which is not based on regulations and permission-seeking, but through creating totally new markets and technological opportunities. There is a plethora of new digital currencies and projects which all are using this same near-zero transaction cost to radicalize pretty much every single area of the contemporary economy through applying this technological advancement of money to their field. Each one of these project are focused on an area where the traditional economy is failing or falling short, and where a new digital version of it can change everything.</p>
  <h3>Initial Coin Offerings</h3>
  <p><img class="alignleft size-medium wp-image-3405" src="https://btctheory.files.wordpress.com/2016/10/screenshot-2016-10-12-at-10-34-50-am.png?w=300&amp;h=248" alt="ICO" width="300" height="248" />Usually a public offering from a company is going to take millions of dollars, lots of legal fees, and huge amounts of regulatory oversight. The massive inefficiencies and regulatory burdens of this process has locked out most people from being able to be involved in this process, and unable to reap the massive profits that can come from high-risk investing like this. Now with the ability to raise tens of millions of dollars using cryptocurrencies, almost anyone can create a public offering for just fractions of what it once cost. The most common way of doing this with crypto at this time is through an initial coin offering (ICO).</p>
  <p>ICO are one of the most powerful modes of investing in the cryptoeconomy. Cutting through all of the red tape of investing and assuming the risks and rewards for oneself; there are huge opportunities (and scams!) that are occurring right now in the cryptoeconomy that are going to fundamentally destroy the old economy modes, in exchange for newer and better ones. <a href="https://btctheory.com/2014/12/04/creative-destruction-of-bitcoin/">The creative destruction of cryptocurrencies</a> is changing all of the old way of investing and economic control, and imbuing that into the digital sphere.</p>
  <p>One of the reasons that this can be done is because of the stable store of value and the unit of accounting that bitcoin provides to these new investments. Through acting as a unit of accounting, people are able to invest directly into ICOs by sending bitcoin directly, and in some cases taking their profits in bitcoin directly too. There are also several great projects being built in the Ethereum ecosystem that are taking this same approach, with profits being paid out in Ether, the currency native to the Ethereum blockchain.</p>
  <p>Let’s take a look at just a few of the great projects that are currently being working on in the cryptoeconomy.</p>
  <h3>Ethereum</h3>
  <p><img class="alignleft size-medium" src="https://pbs.twimg.com/profile_images/686545321900380162/k_2g7M-O.png" alt="Ethereum" width="256" height="256" />I wrote a post recently about how <a href="https://btctheory.com/2016/04/26/ethereum-finance-bitcoin-money/">bitcoin is the money of the internet and ethereum seeks to be the finance of the internet</a>. I see bitcoin as being a core stable money of the internet, like gold throughout the world for most of modern history, and ethereum as being finance for the internet.</p>
  <p>I see a lot of ‘bitcoin 2.0’ being developed with ethereum, and a lot of amazing project are being built on top of it creating ‘Dapps’ or decentralized app. These Dapps are the applications which are going to fundamentally restructure the economy. From self-driving cars that pay for themselves and take themselves to the repair shop, to drones that will drop off your tacos once you send some bitcoin, Dapps are going to change the world.</p>
  <p>These project range from simply dice games, to robust prediction platforms, and public offerings for decentralized companies. Much of the reason for this is the simple object-oriented programing language, Solidity, that was developed for building smart contracts in Ethereum. This allows for simple smart contract to be built in a few days, rather then the few months it would take to do the same with bitcoin.</p>
  <h3>Monero</h3>
  <p><img class="alignleft size-medium" src="https://i2.wp.com/i.imgur.com/Hifozby.png" alt="Monero" width="256" height="256" />Monero in many ways is what bitcoin originally wanted to be. Using a new kind of cryptographic protocol that is different from bitcoin, Monero provides strong anonymity that ensures that users financial information, along with their personal identity is much harder to track then it is with bitcoin. For this reason, several darknet markets have recently started supporting Monero, and Monero looks like it is trying to create its own niche within the cryptoeconomy centered around true anonymity and privacy.</p>
  <p>I personally also like that the devs of Monero are anonymous, as I cannot imagine the state would ever let someone build a cryptocurrencys like this, and not attack them directly. Overall, Monero looks like a strong privacy-centered digital currency that could one day be <em>the</em> privacy currency.</p>
  <h3>Augur</h3>
  <p><img class="alignleft size-medium" src="https://i2.wp.com/sebfor.com/wp-content/uploads/2016/04/Augur-purple-logo.jpg" alt="Augur" width="180" height="180" />Augur is a Dapp, meaning that it was built on top of etheruem as a decentralized app. Augur is the first of a few different prediction market apps that seek to create a prediction platform by letting users bet on pretty much anything. You can check out more information about it here: <a href="https://www.augur.net/">https://www.augur.net/</a></p>
  <h3>FileCoin</h3>
  <p><img class="alignleft" src="https://pbs.twimg.com/profile_images/489720503892856832/XZt8MkUk.png" alt="filecoin" width="185" height="185" />There are a few different projects similar to FileCoin such as Storj and Madesafe, which are all seeking to create a decentralized storage and hosting solution for the web. These are the kinds of huge, infrastructure changing, decentralizing projects which I think can radically change the internet, and in turn society itself. While FileCoin has not had an ICO yet, both Madesafe and Storj have, and they also have small limited application of the project released. These are the sort of radical project that are creating the new cryptoeconomy.</p>
  <h3>Dual Power</h3>
  <p>Through creating alternative, decentralized networks that have the same functions as more expensive, centralized, state-sanctioned networks; we are creating the conditions of <a href="https://en.wikipedia.org/wiki/Dual_power">dual power</a> in order to collapse the state. It is not just the market efficiency of these systems that will do this, but the very decentralized nature of them that will come to fully challenge the power of the state, and the networks they use. Each state-sanctioned network (facebook, fiat money, ISPs, exchange markets, etc.) will come to be challenged by a non-state network, and over time, simply because of the lack of onerous regulations, and the well-placed mistrust of the state; they will come to prevail over the state-sanctioned network.</p>
  <p>The digital age is presenting the interregnum between centralized state power, and decentralized digital power. Over the course of the next decade, states will find themselves struggling more and more with the spectre of the internet and the new forms of power it has created. As states do everything in their power to try to stomp out these new decentralized networks (particularly in more extreme ways as their power is challenged), they will come to find that they do not have power in this space. They will see <a href="https://btctheory.com/2016/07/27/the-destituent-power-of-crypto/">the destituent power of cryptosystems</a>, and will only be able to show their powerlessness against the immanence of systems built upon the power of mathematics, rather than the wills of men.</p>
  			</div><div class="entry-content">
  		<blockquote><p>“How is the discipline of the proletariat’s revolutionary party maintained? How is it tested? How is it reinforced? First, by the class-consciousness of the proletarian vanguard and by its devotion to the revolution, by its tenacity, self-sacrifice and heroism. Second, by its ability to link up, maintain the closest contact, and—if you wish—merge, in certain measure, with the broadest masses of the working people—primarily with the proletariat, but also with the non-proletarian masses of working people. Third, by the correctness of the political leadership exercised by this vanguard, by the correctness of its political strategy and tactics, provided the broad masses have seen, from their own experience, that they are correct.” -Vladimir Lenin, <a href="https://www.marxists.org/archive/lenin/works/1920/lwc/ch02.htm">Left-Wing Communism: An Infantile Disorder</a> (1920)</p></blockquote>
  <p>Vladimir Lenin was the leader of one of the most profound and powerful revolutions that the world has ever seen. Today he has been turned into little more than a goblin of the past by the powers that be. Comprised, defiled, and disposed by the masses due to a century of relentless propaganda against his ideas, and communism itself, most have never read anything of Lenin’s, but will still tell you his ideas were a failure. If we can take the time separate the filth from the facts, we can see that Lenin presented <em>the</em> revolutionary praxis through which the State can be destroyed. Over the course of the 15-years after Lenin released, “<a href="https://www.marxists.org/archive/lenin/works/1901/witbd/" target="_blank">What is to be Done?</a>” he build the largest vanguard party in history and destroyed one of the most powerful nation-states that ever existed. The tactic that allowed for Lenin to accomplish this is called vanguardism.</p>
  <h3>The Digital Vanguard and Proletarian Internationalism</h3>
  <p><img class="alignleft" src="https://s-media-cache-ak0.pinimg.com/236x/23/9b/fd/239bfd709f12fe59d9c80bb1d964f35d.jpg" alt="Che Guevara" width="236" height="304" />To have a deeper understand of what exactly the vanguard is, we can look to international revolutionary and hero Che Guevara, who implemented Lenin’s ideas to help liberate millions across the globe:</p>
  <blockquote><p>“The vanguard group is ideologically more advanced than the mass; the masses understand the new values, but not sufficiently. While among the vanguard there has been a qualitative change that enables them to make sacrifices in their capacity as an advance guard, the masses see only part of the picture and must be subject to incentives and pressures of a certain intensity… All of this means that for total success a series of mechanisms, of revolutionary institutions, is needed.”</p>
  <p>-Che, <a href="https://www.marxists.org/archive/guevara/1965/03/man-socialism-alt.htm" target="_blank">Man and Socialism in Cuba</a></p></blockquote>
  <p>What strikes me about this comment is this is the same sort of ideological position that Anonymous and other hacktivist groups have taken without exposing their statist identities. Though the ‘institutionalization’ of the revolutionary values found within digital technology, activist have been able to strip their physical bodies from the struggle, and enshrined them within digital practice. This allows for the entirety of the revolutionary vanguard to exist solely upon digital means alone. What makes this so incredible is that it allows for the fusion of anarchist and communist principals through practice alone. This practice allows for organization around the principals of strong crypto; which blinds the state, and stripped them of their ability to bring violence to revolutionaries.</p>
  <p>The second important principal that comes from this digitization of the vanguard is the completeness in which it embraces proletarian internationalism. Through stripping our physical selves from the revolutionary praxis of the internet, we are forced to operate on only a global scale. There is no way to see our nationalities; only our mutual humanity–we can only deduce from our online interactions that the other person is human, and that is it. With the physical protection that is afford to us through this medium, it allows for us to see the full vulnerability of other humans within this system. Though we may not know the physical bodies of those we interact with, we can still see the fundamental properties that make them as flesh and blood as you and I. To see humans first and foremost as humans, and not as nationalities, sexes, races, or labor, is what forces the perspective of proletarian internationalism on to the digital vanguardism. This principal is forced upon from without, unlike communist vanguardism which vulgarizes its own principals in the name of one official power.</p>
  <h3>To Build a New Way Forward</h3>
  <p>When we can understand <a href="https://btctheory.com/2014/09/03/bitcoin-and-the-internet-as-ideological-apparatuses/" target="_blank">the internet as a revolutionary apparatus</a> to destroy the state and usher in a new epoch based upon digital practices alone, we can see that the first two of Lenin’s principals of the vanguard have already formulated themselves. Heros like Ed Snowden and Julian Assange among many others, have seen the truly revolutionary power of the internet, and have used that power to show the world what a single human can do against the catastrophe of governments. They have set an example that shows the truly revolutionary power of the internet. This is why they have been so ruthless pursued by states, because they show how vulnerable their corrupt system is to our digital power. This power has been know for the better part of a decade, but it has only been with the advent of strong crypto that a single person can stand against the supposed omnipotence of the state; and prove that omnipotence to be little more than smoke and mirrors.</p>
  <p>The second of Lenin’s principals (to organize with the broadest swaths of society) has been seen in the Arab Spring, and the failed Occupy uprisings. It proved that the internet can be used to communicate, and organize around revolutionary change. Since 2011 we are seeing more and more direct action being taken by hacktivist groups and individual strikes against various aspects of the state capitalism machine. Each victory in the form of data theft, a site take down against a major corporation, and the advent bitcoin all are displaying the weakness of the political-economic system. However, we also know from the aftermath of these events that the final, and most essential component of Lenin’s theory has not been enacted: Political leadership, strategy, and tactics.</p>
  <h3>The Need For A Revolutionary Vanguard</h3>
  <blockquote><p>To quote Che again, “At the risk of seeming ridiculous, let me say that the true revolutionary is guided by great feelings of love. It is impossible to think of a genuine revolutionary lacking this quality. Perhaps it is one of the great dramas of the leader that he or she must combine a passionate spirit with a cold intelligence and make painful decisions without flinching. Our vanguard revolutionaries must idealize this love of the people, of the most sacred causes, and make it one and indivisible.”</p></blockquote>
  <p>We must know and understand that is through our conviction that people shall always matter more than money, that we can change the world. To know that it is we who will fight against the wicked and corrupt, that it is us that shall liberate the impoverished and smash the chains of the oppressed! We do not do this for our hatred of those who oppress us, but for the love of those that we demand to be given the freedom they are rightfully entitled to. It is only through the revolutionary zeal and infinite capacity of our love for humanity over all else, that we can create a new, and better world.</p>
  <p>Today we have a choice: we can continue to work within the system, when all evidence points to the corruption, and impossibility of creating substantial change, or we can take it upon ourselves to start actively organizing against this system. The only way that we will be able to create revolutionary change is through embracing the third and final principal of Lenin’s revolutionary vanguard: through political leadership, strategy, and tactics to help steer the masses towards liberation. The only way that this can be done is through the open organization and promotion of revolutionary tactics against the machine. By using the power of bitcoin, and the censorship-resistant blockchain we can create an alternative economy and society that is fully outside of the hands of the state.</p>
  			</div><div class="entry-content">
  		<blockquote><p><img class="alignleft" src="https://i0.wp.com/www.counter-currents.com/wp-content/uploads/2014/08/1984.jpg" alt="orwell" width="318" height="454" />“Don’t you see that the whole aim of Newspeak is to narrow the range of thought? In the end we shall make thought-crime literally impossible, because there will be no words in which to express it. Every concept that can ever be needed will be expressed by exactly one word, with its meaning rigidly defined and all its subsidiary meanings rubbed out and forgotten. . . . The process will still be continuing long after you and I are dead. Every year fewer and fewer words, and the range of consciousness always a little smaller. Even now, of course, there’s no reason or excuse for committing thought-crime. It’s merely a question of self-discipline, reality-control. But in the end there won’t be any need even for that. . . . Has it ever occurred to you that by the year 2050, at the very latest, not a single human being will be alive who could understand such a conversation as we are having now?”</p>
  <p>-George Orwell, 1984</p></blockquote>
  <p>Newspeak was the fictitious language of the world of 1984. It was part of the process of using propaganda to mold and manipulated thoughts and dialog of the masses. It is through the corruption, contortion, and disembowelment of words from their meanings that language itself becomes a weapon of the oppressors. They seek to create a world in which we cannot explain things as they are–they create a world in which there simply are no longer the words to do so.</p>
  <p>It may seem like an insignificant point at first glance, but this is the exact nature of the use of the word ‘blockchain’ to replace bitcoin. Through the repeated ‘blockchain good, bitcoin bad’ rhetoric there is a slow manipulation of the facts as they truly are. They are to make bitcoin little more than a financiers plaything, not a revolutionary tool for the masses.  By divorcing the blockchain from bitcoin; bankers, financiers, and capitalist scum of all kinds are trying their damnedest to make bitcoin into a kind of technological revolution that has nothing to do with bitcoin! This is the same process that every form of personalized power has gone through at every stage of their advancement–a manipulation of the facts as they stand in order to disempower those who it would benefit from it.</p>
  <h3>Divorcing Value From Money</h3>
  <p>Money plays the greatest role in the<a href="https://btctheory.com/2014/06/23/bitcoin-and-the-history-of-money/" target="_blank"> formation of history</a>, and it was not too long ago that most people would laugh and scoff at the idea of using paper money that was backed by nothing. Furthermore, they would think it is insane that you could not use gold or silver for a transaction–a money that has proven its worth over millennia, and has value imbued within it. Today the trillions of dollars that are circulating around the global economy are backed by nothing more than the violence of whatever state controls that money–there is no value whatsoever behind their worth paper; just the threat of their violence.</p>
  <p>Bitcoin can be compromised in the same fashion that money itself was more than a century ago. Governments and bankers will try to take it over and tell us that it is for our own good. They will try to make the blockchain a settlement layer for themselves, while criminalizing the use and acceptance of bitcoin. This process is already underway with media conversation about bitcoin being the money criminals, hackers, pedophiles, and terrorists, while the blockchain is the ‘revolution’ that can change banking for the better.</p>
  <p>As this conversation continues, everything will be done to attempt to delegitimatize bitcoin and drive a wedge between it and the blockchain. History will show us that people are more likely to believe that which they are told, then to go and discover for themselves what the true nature of things are. It is through this very path that everything will be done to stop bitcoin from becoming the sovereign economic power that it is destined to become, while making the blockchain into a powerful tool for only the economic elite.</p>
  			</div><div class="entry-content">
  		<p>What we have been taught about money and the economic system is little more than a collection of lies, and propaganda shoved down our throats at the point of a knife. Our economy is far from being fair, or free; and we are exploited by the whims of capitalist whom have received the seal of approve from all governments. The financialization of the economy by the state started with the creation of the Federal Reserve, and finalized with the abandonment of the gold standard. This was the beginning of the end of money having independent value from governments. When governments of the world discovered at Bretton Woods that they could simply end the convertibility of gold, and all governments could move forwards with only fiat money they were exuberant. This removed the greatest check on government power that has ever exist: the power of the purse.</p>
  <h3>To Smash the Chains</h3>
  <p><a href="https://btctheory.files.wordpress.com/2014/12/0e99d-resist_oppression_communism_will_prevail_india_revolution_operation_green_hunt_cpi-maoist.png"><img class="size-medium wp-image-1836 alignright" src="https://btctheory.files.wordpress.com/2014/12/0e99d-resist_oppression_communism_will_prevail_india_revolution_operation_green_hunt_cpi-maoist.png?w=233&amp;h=300" alt="resist_oppression_communism_green" width="233" height="300" /></a>The legacy of capitalism is deep, profound, and all encompassing within our society. The <a title="Reification" href="http://en.wikipedia.org/wiki/Reification_(Marxism)" target="_blank">reification</a> of everything by capitalism has left no stone unturned, and has sucked every facet of life into the economic sphere. This is not the capitalism that Smith and Ricardo understood; but a distorted, anti-human Deus ex Machina careening toward the destruction of both humanity and Earth. This greatest evidence of this is in the near complete and total environmental destruction that we have experiences all over the world with the sixth great extinction of species from this planet. Indiscriminate of nationality, race, or origin; our oceans, skies, water, and land has all been polluted and raped by the powers that be. The very governments that were empowered with protecting our sacred rights were overthrown by capitalist gangsters; thugs in suits who auctioned everything off for a meager thirty pieces of silver.</p>
  <p>The issue is not with the capitalists who only know corruption and theft–this should be expect from them most of all! The issue is with the state, politics, and the corruption that has enveloped all aspects of our social spheres. This system is corrupted and festering to the core; it cannot be saved, nor should it. The men of politics who hold themselves in such high esteem for being the negotiators of the prostitute our political system are the very ones that hold us down to be raped and used, again, and again by the capitalist machine. Our cries of consanguinity are never heard; we are little more than objects to be tolerated by them, while they exploit us to our deaths. If we are to be liberated, and free, as we were promised by our forefathers and the constitutions that govern us, than we must smash the chains of economic enslavement which we keeps us tethered to the destructive machine that we call capitalism.</p>
  <h3>To Break a Monetary System</h3>
  <p>We must harness the power of <a title="between entrepreneurs and capitalist" href="https://btctheory.com/2014/12/31/entrepreneurs-and-capitalist/" target="_blank">markets and entrepreneurship for the good of all</a>, while dividing ourselves from the parasitic nature of capitalism. We must rip power away from a corrupt state which empowers a very small, exclusive class of people to the right of destroying the world of tomorrow, for a collection of trinkets today. If we are to ensure that we have something to offer to our children other than imprisonment, and a burned Earth, than we must choose to end this system of abuse now, today, and permanently.</p>
  <p>This can be done. We have the means to break this totalitarian socio-political-economic system of the old world, and usher in a new era of global development outside of the hands of both the state, and capitalism. We can reappropriate our respective national monetary systems, for new, independent digital ones. Through this single action alone–through the reclamation of our economic power–we shall create a domino effect that shall ripple throughout the economic, political, and social structures of the world. Through using an independent money whose control and power comes from <em>outside</em> of the state, people can reappropriate their economic power for themselves. This will come at the direct expense of the state and capitalist who bleed us like the vampires and leeches they are. By breaking the monopolistic control of the means of exchange by the state, we shall expropriated the system of exchange, and the means of exchange itself back to its rightful owners: the general public.</p>
  <p>We see the corruption of their system. Beneath the shimmering veneer of capitalism’s accomplishments and supposed progress, lay the untold billions of shatter lives. At its base we see that the law is nothing more that offical violence–state sanctioned terrorism with propaganda from a capitalist third estate.  To fight their violence we must use the most powerful weapon at our disposal to rid ourselves of this barbaric system:</p>
  <h2><em>Non-violent, direct economic action</em></h2>
  <p>Through simply using another form of money, we banish the violence and vicious fist of the state from the economic power that each one of us generates. No longer would the state have the ability to rob us, nor would they be able to fund their crimes, or continue their corrupt regimes. To cripple the monetary system would strike at the very heart of the corrupt state-capitalist machine, and would cause for it to come to a grinding hault.</p>
  <h3>International Money for All</h3>
  <p><a href="https://btctheory.files.wordpress.com/2015/05/screen-shot-2015-05-10-at-10-03-06-pm.png"><img class="alignleft size-medium wp-image-2288" src="https://btctheory.files.wordpress.com/2015/05/screen-shot-2015-05-10-at-10-03-06-pm.png?w=300&amp;h=187" alt="bitcoin-network" width="300" height="187" /></a>Each state is invested into its own system of governance, money, and taxes so that the small powerful elite can rule over all for their own pleasure. They keep their power not through democratic means, but through oppression, division, regulations, controls, taxes, boarders, prisons, levies, and so much more. This is not for protection of the masses, but their oppression. This is not create justice, but to maintain injustice. Governments create these artificial rules and regulations so that they may steal from their people, and keep them divide and silent. We must see their petty tactics for what they are, and see the magnitudes of our own strength which we have in our numbers.</p>
  <p>For the first time in human history we can smash these artificial boundaries and false consciousnesses of nationality and statism, and find solidarity in working together through simple rejecting their corrupt economic and political systems. There are billions of people across the global that create trillions of dollars of economic wealth each year; and yet these very same people live a life of poverty and insecurity from the exploitation they face. Through creating a new popular front against capitalist exploitation under the guise of the state, we can create a new economic and political movement that can break the bonds of debt that have enslaved us.</p>
  <p>Using digital currencies as a political action, we can reappropriate our economic wealth away from the hands of corrupt politicians and their capitalist allies, while create a revolutionary new way forward. This single action alone can ensure that we will no longer be enslaved to the same system of debt bondage that has created the conditions of the world today. Together, as a single unite body of free people, we can banish the last vestiges of slavery from this planet for all history moving forward.</p>
  <p>The crux of power within this system is control of the economy. This control is exerted through the monopolization of the object of exchange: Money. Governments steal fragments of the wealth from each and every person on this planet through taxation and inflation, while also give themselves the power to punish with legal violence and death to anyone who opposes this monopoly. The minders of this monopolies are the capitalist banksters, thugs who strut about in fine suits with no shame of their avarice, or the blood that taints their money. Through the direct expropriation of the system that benefits only the 1% at the expense of everyone else, we will  create better conditions for the great tide of all.</p>
  <h3>International Direct Economic Action</h3>
  <p><a href="https://btctheory.files.wordpress.com/2015/05/solidarity.jpg"><img class="aligncenter wp-image-2299 size-full" src="https://btctheory.files.wordpress.com/2015/05/solidarity.jpg?w=1008" alt="solidarity" /></a></p>
  <p>We do not seek to create a party or to organize with titles and salutations; we simply demand direct action. We understand the most significant action we can take is to refuse to participate within the old economic system, while building our own independent one. Through boycotting fiat money and using digital currencies instead, we create a dual power of both economic boycott from the current system, and economic solidarity with the new emerging one.</p>
  <p>This new system of exchange is not based upon the false nationalities that have been assigned to us, but upon the permanence of mathematics that applies to all of us. It is a form of money that is inclusive of all peoples, regardless of whatever oppressive state one may be forced to live under. Most of all, bitcoin is a form of exchange that is outside of the control of both statist scum, and capitalist pigs. It is a totally new form of money upon which we can build a new system of exchange, and an independent economic system. If we are ever to liberate ourselves from the chains of capitalism, and the impressment of debt, then building a new and independent economic outside of their control is the only way that we can move forward.</p>
  <p>Bitcoin and other digital currencies can be the tools upon which we build this great new economic and monetary union–but only if people are willing to learn and participate. We know that there is a deep <a title="Bitcoin’s People Problem" href="https://btctheory.com/2015/01/08/bitcoins-people-problem/">people problem with bitcoin</a>, and that we will need to educate and agitate if we are to create a real and substantial change. This is the start of the global economic revolution that will smash down the artificial boarders that separate us, and will economically unite us against our respective oppressors. Bitcoin is the new economic Popular Front against the exploitation of capitalist, and enslavement from tyrannical state governments around the world.</p>
  <p>—</p>
  <p>Next: <a href="https://btctheory.com/2014/12/06/bitcoin-economic-resistance-and-justice/" target="_blank">Bitcoin, Economic Resistance, and Justice</a></p>
  			</div><div class="entry-content">
  		<h3><img class="alignleft" src="https://i0.wp.com/www.alternet.org/files/styles/story_image/public/story_images/anarchists.jpg" alt="" width="310" height="233" /><em>It’s about power</em></h3>
  <p>Bitcoiners are part of a new political, economic, and social class. At the core of our tenets is the recognition that bitcoin and digital currencies are powers in themselves, and that they cannot be restricted by the despotic tyranny of States, or their capitalist allies in banking. We are not united by our creed, nationality, or gender, but by our economic objectives and the advancement of our technology. We are the ones that shall force the fiat banks towards their death, and we are the ones that shall make the State capitulate on its monopoly on legal tender and the mode of exchange. It is time for the youth of this world to rise and take their rightful place in history by striking down the awful corrupt governments of the past that have sold us out. No longer do we need to remain subservient to this system of exploitation and alienation. </p>
  <h3><a href="https://btctheory.com/2015/11/03/the-revolutionary-vanguard-of-the-digital-age/" target="_blank">The Digital Vanguard</a></h3>
  <p>There is nothing that ties any of us together–no names, no identities, no bodies–just Bits of data being sent across the Great Commons of the Internet. Together we have created a multi-billion dollar economy from nothing just five years ago. Those who hodl bitcoin are far past the point of doubting the success of bitcoin–we <em>know</em> bitcoin will be successful. We see its power, we see its efficiency, and we see the world that we are to create with it–and governments of the world and their corrupt allies are not part of it.</p>
  <p><img class="alignright" src="https://i0.wp.com/povertythinkagain.com/files/wp-content/uploads/2009/09/Double_Burden.jpg" alt="" width="314" height="402" />We are the Vanguard of bitcoin. We are the ones who shall fight the Goliath of Finance and the Leviathan of the State and watch them fall from the pedestal of human they mounted themselves upon. We shall watch them fall, we shall watch them burn, and we will do nothing but stoke the flames. We will do simply laugh and walk away, disengaging them and continuing to build the new economy that is based upon the values and virtues that has been put into the code.</p>
  <p>Over the last few years we have poured our hearts, minds, souls, and fortunes into this project. We have made the market, built the applications, and connected the nodes, and militantly worked on security to ensure our success.</p>
  <p>Indeed, detractors will do everything they can to discourage us. Even in that very word, we can see their cowardice; to dis-courage. They lack courage; and are spineless, sniveling, fear-dominated people who couldn’t fight anyways. They only see a world of 9-to-5 enslavement as a favor that we should be grateful for. These people cowtow under the unjust laws of their masters; for anything their masters choose, for them <a title="On the Death of Justice" href="https://btctheory.com/2014/12/09/death-of-justice/" target="_blank">becomes law and justice</a>. We refuse to bend our necks to these men: we know the crime against humanity they have purported, and we shall resist them.</p>
  <p>Together, united in the cause of building a better money, we shall also build a better world. We have made ourselves nearly invulnerable to the malice of the state, and rage of the banks though ensuring our Privacy. We know from the code that Privacy is our immutable Law; for privacy is what assures us not only our safety, but our equality in dialog as well. We know nothing of the other parties that participate with us, except for the Solidarity we have with one another. Together we are building an economy that is based upon fairness, equality, and individual sovereignty–and we are not asking for permission to do this.</p>
  <h3>To Build a Free World</h3>
  <p>We are the ones that have ensured the success of bitcoin, and we have been and shall continue to be rewarded kindly for such loyalty. No one came to us and said, “You need to invest and support this,” In fact, many of us were mocked and called fools for ever believe in it. But onward and upwards we went, making the long journey from the obscure origins of bitcoin to the multi-billion dollar economy it is today. No one told us we would make 5, 10, or 20 times what we originally invested–we did that.</p>
  <p>Famous vulgar philosophers, politicians, investors, economist, and journalist from all around the world have insisted that bitcoin would be nothing. They said it couldn’t be a currency, and that it was only used by drug-dealers and pedophiles. Every single step of the way they laughed at us, mocked us, and insulted us…and yet we are still here, growing, building, and pulling more and more into our sphere of influence, and away from theirs with each passing day. So quietly and seditiously, people are coming to understand the nature of money, and realizing that the banks, and the state are using that to keep them oppressed, and divided from our true political goal:</p>
  <p><img class="alignleft" src="https://i1.wp.com/40.media.tumblr.com/c0c843f700ed45a7171a9804e087cf22/tumblr_mvf24a7ILS1qkmapxo1_500.jpg" alt="Freedom-has-meaning" width="350" height="385" /><strong>Freedom</strong>.</p>
  <p>True, unadulterated, messy, complex, Freedom.</p>
  <p>Freedom that cannot be suffocated because of the fears of pathetic men who need to terrorize us into compromising this most sacred of rights. Freedom that cannot be taken at the whims of the states, or the cries from banks.</p>
  <p>Freedom–despite being so thoroughly abused, manipulated, and contorted by men of power for nefarious deeds–is a word that still has meaning. Words will always seek to give themselves means for what they are and what they represent. The word ‘freedom’ will always sound hollow coming from the mouths of oppressors to justify their despotism, which will also make present the need and demand for what ‘freedom’ truly means.</p>
  <p>Tragically, we were birthed into a world where the fascist won long ago, and created a sophisticated oppressive apparatuses of nightmares to terrorize us into giving more and more power to the state, and their allies. This manufactured terrorism from our masters has allow for us as a people–fearful, and trembling–to sacrifice our essential liberties, bastardizing our sacred constitutional rights, proving their worthlessness without the force of men, and the will to protect it behind them.</p>
  <h3>Bitcoin is not about money</h3>
  <p>It has never been about money, it’s about freedom and what that means for our society today. As we descend into the panopticon the state is erecting at this very time, preparing the gulags in the deserts, and military control of these states, we declare that we shall not go quietly into that dark night. We declare that a government that is marked by every act which may define a Tyrant, is unfit to be the ruler of a free people. Together we are building the mode of resistance that shall cause for the empire of paper to collapse, which will free everyone from the shackles of debt, and the chains of domination.</p>
  <p>We shall no longer be force and intimidate us into playing by the corrupt and hollow laws of the state. We see the men of government, banking, and capitalism for the criminals they are, and for the damage they have done to us. We see how they have betrayed their oath, their nation, and their honor. Their words, and their threats are meaningless to us. We are building a better world that they are not a part of, nor will they be allowed to be a part of. We no longer need them.</p>
  <p>—</p>
  <p>Next: <a href="https://btctheory.com/2015/03/19/revolutionary-syndicalism-bitcoin/" target="_blank">Revolutionary Syndicalism of Bitcoin</a></p>
  			</div><div class="entry-content">
  		<p>A little more than a year ago I covered <a title="Bitcoin's Creative Destruction" href="https://btctheory.com/2013/11/08/bitcoins-creative-destruction/" target="_blank">bitcoin’s creative destruction</a>, and how bitcoin is more efficient money system on several economic levels. We also explored how <a title="The Near Zero Transaction cost of Bitcoin" href="https://btctheory.com/2013/10/21/bitcoins-near-zero-transaction-cost/" target="_blank">the near-zero transaction cost of cryptocurrencies</a> creates a monetary system that shall always be more efficient than fiat monetary systems. It is because of this fact that we shall see bitcoin destroy the contemporary models of finance, banking, and monetary systems; while as the same time building something new, better, and more egalitarian in its place. As the bitcoin ecosystem grows, we will see a radical shift of money, finance, and banking away from huge institutions that are embedded within the capitalist structure, to a decentralized, global framework of economic exchange divorced from the state. Schumpeter described this process of creative destruction in chapter 7 of Capitalism, Socialism, and Democracy and how capitalism incessantly transforms the economic landscape:</p>
  <blockquote><p>“In capitalist reality as distinguished from its textbook picture, it is not that kind of competition [oligopolistic competition] which counts but the competition from the new commodity, the new technology, the new source of supply, the new type of organization (the largest-scale unit of control for instance)—competition which commands a decisive cost or quality advantage and which strikes not at the margins of the profits and the outputs of the existing firms<em> but at their foundations and their very lives</em>.”</p></blockquote>
  <h3><img class="size-full wp-image-1800 alignright" src="https://btctheory.files.wordpress.com/2014/12/58a7e-9781891396519.jpg?w=1008" alt="58a7e-9781891396519" />Smashing Monopolies with Advanced Technology</h3>
  <p>The superiority of bitcoin as a money system is something that will be proven in the long-run of decades. What bitcoin has accomplished in 5 years alone is astonishing. As a non-goverment money system, bitcoin is not subject to the same legal system, taxation, inflation, or political pressures that all fiat money systems must experience. Bitcoin explicitly lacks the <a title="Chartalism" href="http://en.wikipedia.org/wiki/Chartalism" target="_blank">charlatan</a> features that all fiat money systems–this is a feature, not a bug.</p>
  <p>Bitcoin exist outside the framework of sovereignty of the state. Bitcoin cannot derive any legitimacy from laws or enforcement, but only from its own merits as money. In doing this, bitcoin points out how corrupt our current economic and political system is, while creating a totally new form of money that is a radical alternative. Bitcoin points out the corrupt relationship between the state, institutions of money, and how that relationship creates oppression for all people.</p>
  <p>Today, the oligopolist and monopolist have won. A small handful of companies control vast swaths of industry with the full cooperation of the state. Government pay huge subsidies to mega-corporations while child homelessness is at an all-time high. Governments use the money they control not to help those in need, but to make illegal wars both domestically and abroad. Politicians are paid off openly and without shame, while the banks readily kick hundred of thousands of people out of their homes and into the streets with the full support of the law. Police openly murder children and are readily acquitted and protected by the legal system.</p>
  <p>This is a form of <a href="http://www.truthdig.com/report/item/sheldon_wolin_and_inverted_totalitarianism_20151101" target="_blank">inverted totalitarianism</a> monopolizes the structure of power through omitting any democratic process from the economy system. The monopoly of banking, the monopoly of the law, and the monopoly of the issuance of money have all been forcibly justified through extreme campaigns of fear-mongering around the ‘need for safety’. This has nothing to do with economics, efficiency, or safety–it is about corruption and using the state to create laws that protect incumbent industries and politicians.</p>
  <p>Breaking these monopolies is the kind of creative destruction that bitcoin is engages in through applying a superior technology. The restructuring of economic power into a digital realm will not only dramatically redistribute wealth away from the old order, but it will also radically transform the size and breadth of the financial economy by several fold. The financial and banking systems will become much more accessible, <a title="2013 FDIC National Survey of Unbanked and Underbanked Households" href="https://www.fdic.gov/householdsurvey/" target="_blank">the nearly 10 million american adults lacking a bank accounts today</a>, and the 2.5 billion unbanked all over the world can now have a real opportunity at financial access in a way that has never been experience before. Those who build these new systems, and utilize the power of bitcoin to revolutionize the financial and banking industries, will be the champions of this new digital economy.</p>
  <h3>The Revolution of Accounting</h3>
  <p>The creative destruction of bitcoin strikes at the very root–the very object of exchange–of the capitalist economic structure: money. It is through the explicit destruction of the current payment systems, legal tenders, and the monopolization of those, that bitcoin will reinvent the entire economic. From destroying these old model of finance, banking, and exchange; the entire infrastructure around economic exchange will be recreated in a better, more effective model. A similar revolution happen around 800 years ago in the north of Italy with ‘discovery’ of double-entry accounting.</p>
  <p>This novel approach to accounting allowed for merchants to have a much better understanding of their total assets and liabilities, as opposed to the old version of just keeping a daily diary of what they possessed. The real revolution that came from this accounting system was the way to measure, value, and utilize various assets and liabilities in new ways–equity was birthed into the world. This transformed non-active capital that was previously doing nothing, into doing something. Adam Smith talks at further length about this in The Wealth of Nations:</p>
  <blockquote><p>“<img class="alignleft" src="https://gradesaver.s3.amazonaws.com/uploads/author/image/240/temp_file20141028-16184-1hnpdp4.jpeg" alt="Adam-smith-wealth-of-nations" width="223" height="260" />It is not by augmenting the capital of the country, but by rendering a greater part of that capital active and productive than would otherwise be so, that the most judicious operations of banking can increase the industry of the country. That part of his capital which a dealer is obliged to keep by him unemployed and in ready money, for answering occasional demands, is so much dead stock, which, so long as it remains in this situation, produces nothing, either to him or to his country. The judicious operations of banking enable him to convert this dead stock into active and productive stock; into materials to work upon; into tools to work with; and into provisions and subsistence to work for; into stock which produces something both to himself and to his country.”</p>
  <p>-Adam Smith, <a title="The Wealth of Nations" href="http://www2.hn.psu.edu/faculty/jmanis/adam-smith/wealth-nations.pdf" target="_blank">The Wealth of Nations</a></p></blockquote>
  <p>Though this seems to be the most boring possible topic to be revolutionary, it certainly was. With the development the merchant banks in Northern Italy, now there was a way in which the ‘dead stocks’ of stationary capital could be commoditized. From the ability to much more accurately understand one’s own finances through double-entry accounting, there became a whole new way to utilize, and understand money. This was the revolution that helped create finance as we know it today, and is what also propelled the advancement of capitalism to its place on the world stage it is today.</p>
  <p>The great advancement that came from double-entry accounting was the novel approach of pooling money through banks, and then being able to utilize that capital as an active, and productive investment, rather than a dead stock. This meant that many, many more people could access capital for investments than there ever had been available before. This new market for capital and mode to utilize it, fundamentally restructured the economic fabric of life in a way that would indelibly change the future, and advance it towards one of capitalism. This was the first revolution of accounting, and now 800 years later, we are having the second revolution of accounting and measurements.</p>
  <h3>Building The New in The Shell of the Old</h3>
  <p>The creative destruction embedded within capitalism can best be understood as a dual force of creative power. It seeks to destroy and defile old ways in the quest to create something more efficient, more masterful of the task at hand. The only way that we can build a new and better world, is through first through destroying the old ways. It is only once we have cleansed ourselves of the inefficiencies of the past, that we are able to fully manifest and powerfully produce the changes we wish to see in the world.</p>
  <div class="wp-caption alignright"><img src="https://i1.wp.com/upload.wikimedia.org/wikipedia/commons/1/16/Luca_Pacioli_%28Gemaelde%29.jpeg" alt="" width="351" height="317" /><p class="wp-caption-text">Luca Pacioli–remembered for writing down how to do double-entry account. No one knows who that other guy is.</p></div>
  <p>The revolution of bitcoin is not just in destroying these old financial industries; but building the new system that will be radically better than anything we could imagine. In this brave new world we are quickly coming into, the financial industry as we know it will be crushed in order to make way for the new system of finance. Bitcoin and other digital currencies simply have <a title="bitcoins near zero transaction cost" href="https://btctheory.wordpress.com/2013/10/21/bitcoins-near-zero-transaction-cost/" target="_blank">too low of a transaction cost</a> when compared to the transaction cost of any fiat money system.</p>
  <p>The development of the triple-entry accounting system of the blockchain has at its core the same praxis and creative destruction that double-entry account had: to destroy the old order of exchange, to make way for the new, better, and more effective system that can reach and serve many more people than the old system ever could.  What is so revolutionary about this new mode of economic organization is now the arbitrator of measurements within the system of exchange (bitcoin itself) is subject to the same accounting standards as all other actors within the system–the bankers and politicians cannot cheat this system for their own benefit. The bitcoin ecosystem <a title="Bitcoin as commodity money" href="https://btctheory.com/2014/11/19/bitcoin-as-a-commodity-money/" target="_blank">has no way it can just make up new bitcoins</a>, as the state and banks can do with fiat money, or how they can debauch commodity-monies. The real revolution within bitcoin is that makes the banksters, the financiers, and the state subject to the same economic laws that govern everyone else.</p>
  <p>Through eliminating the costly, inefficient, slow, burdensome, and corrupt contemporary system of banking, finance, and money itself; there is a whole new economy world to be created. This will exponential increase the productivity of capital, as it no longer has to be subservient to the state, their regulations, or laws that protect their cronies. Bitcoin ensures there is no longer any physical space that must be defended to protect money, so the infrastructure of this new form of capital can extend well beyond the branches of banks, or physical kiosks. Money no longer has any masters–it is free to create the world it sees fit.</p>
  <h3>What Must Be Done</h3>
  <p><img class="aligncenter" src="https://i2.wp.com/40gu8l1vss3518atry3qjf1w.wpengine.netdna-cdn.com/wp-content/uploads/2011/07/join-the-revolution.png" alt="" width="600" height="250" /></p>
  <p>We have the tools, now we must build the new system. Rome was not built in a day however, and what we are attempting to do is to fundamentally restructure the most prominent aspect of our society and world today: money and wealth. This is an ideological battle of the greatest kind. We are not just trying to address the economic issues at hand, but <a title="The Magic of Money, The Science of Bitcoin" href="https://btctheory.com/2014/08/13/the-magic-of-money-the-science-of-bitcoin/" target="_blank">the mysticism and magic of how money functions</a>. These are huge political, social, and ethical issues that many people today would rather not question or talk about–they would prefer to simply shove their head in the sand and refuse to believe that this is possible.</p>
  <p>However the younger, technologically inclined and technology trusting generations will soon come into power against a political and economic system that has willingly and enthusiastically sold them out, disparaging them each step of the way. Spite and the demand for justice is a very powerful thing, and the true revolution is going to come when the youth from all around the globe realize that they can economic and politically organize themselves against the respective systems that have exploit them. The revolution is already in motion; what remains to be seen is how quickly people are going to be willing to seize it for themselves.</p>
  <p>—</p>
  <p>Next: <a href="https://btctheory.com/2013/09/17/hayeks-promise/" target="_blank">Hayek’s Promise</a></p>
  			</div><div class="entry-content">
  		<blockquote><p>“Yes, [we will not find a solution to political problems in cryptography,] but we can win a major battle in the arms race and gain a new territory of freedom for several years. Governments are good at cutting off the heads of a centrally controlled networks like Napster, but pure P2P networks like Gnutella and Tor seem to be holding their own.”</p>
  <p>–Satoshi Nakamoto</p></blockquote>
  <p>This is one of the few political comments that we are offered from Satoshi. This is a reference to Micheal Foucault’s interview on power and sovereignty found in Truth and Power:</p>
  <blockquote><p><em><img class="alignleft" src="https://i0.wp.com/www.theater-historiography.org/files/2013/09/19702_michel_foucault2.jpg" alt="" width="126" height="169" /></em><em> The monarchy presented itself as a referee, a power capable of putting an end to war, violence and pillage and saying no to these struggles and private feuds. It made itself acceptable by allocating itself a juridical and negative function, albeit one whose limits it naturally began at once to overstep. Sovereign, law and prohibition formed a system of representation of power which was extended during the subsequent era by the theories of right: political theory has never ceased to be obsessed with the person of the sovereign. Such theories still continue today to busy themselves with the problem of sovereignty. What we need, however, is a political philosophy that isn’t erected around the problem of sovereignty, nor therefore around the problems of law and prohibition. We need to cut off the King’s head: in political theory that has still to be done.</em></p></blockquote>
  <h3>Sovereignty, Legitimacy and How Violence Connects Them</h3>
  <p>The fundamental issue at hand is one of sovereignty–who has the supreme right of rule? Today, governments around the globe have anointed themselves with the supreme right to rule over almost every aspect of life. This is not because of their majesty or our consanguinity, but simply from their monopolization on violence, and the legal framework they use to justify it. There has been a long, and precipitous train of abuses that has created the world as it is today, and considerable injustice that has forced us to ask such questions.</p>
  <p>We first must questions where this Right comes from. This Right is not only a historical residue impressed upon us from the evolution of society from feudalism, but also an ideological perspective that is reinforced incessantly throughout our lives. When we reduce this power down to how it operates on an individual and organizational levels, we can see beyond the garb of officialdom, legitimacy, and righteousness that it purports to be, for the crude, barbaric machine that it really is: violence organized under the banner of the state.</p>
  <div class="wp-caption alignleft"><img class="" src="https://btctheory.files.wordpress.com/2014/10/a897c-64-2-rodriguez_fig01f.jpg?w=400&amp;h=296" alt="" width="400" height="296" /><p class="wp-caption-text">This action was legal for the police to carry out–no violence came to the officer for doing this.</p></div>
  <p>Violence is the basis of power that governments use to project their legitimacy into the world. This is done through explicit means, such as police, military, prisons, laws, and regulations; but also through discreet means such as education, religion, bureaucracy, and especially elections. The discreet channels of what is seen as ‘correct’ or ‘legitimate’ is the most powerful form of controlling the conversations of ‘what is violence’ and who is entitled to it. This creates the context for which violence can be used, and thus justified. The utilization of violence to enforce the status quo (i.e. the law) is justified by the ideological discipline that demands authority to be respected, and obeyed for no reason other than that ‘authority should be respected, and obeyed’.</p>
  <p>The fact that we are allowed to vote for one of two representatives that invariably represent the same corporate interest of the status quo, is part of the greater dialog that has us believe the legitimacy of such violence. We are told that we have ‘democratic power’ and that if we can just elect the right person (despite having no sort of electoral process for the police or army), that we will be able to solve our political woes. The truth of the matter is distinctly different.</p>
  <p>There are people in this world that can initiate violence against others within explicit legal means with no form of recourse. We are subjects underneath the law and subject to it, and we have masters that are outside and above the law; which ironically calls itself the ‘law enforcement’.</p>
  <p>It is the threat of this systematized violence in all capacities (legal, economic, personal) that governments base their power from. It is under this banner of legitimacy via legal violence that all governments have operated through all of history. That might shall make right, and as the official judicial decision, that is final. This is the legal bases of the laws of the state, and this is why they can command your death–because they have the power to do so.</p>
  <p>Sadly, there simply has never been any other way to politically organize with the exception of sporadic, unsustainable revolutions that fold back into the same power structure that rely on violence. As revolutionary chaos grows, it harnesses the apparatuses of power for itself, and becomes the Specter of the State, legitimizing its own violence and corruption.</p>
  <p>This is the theory of the sovereign–how political institutions create power over one another–it is done from the point of a sword, again, and again; through all of history.</p>
  <p>This is the revolutionary struggle for sovereignty. As Foucault pointed out, so long as we are still grappling with this central issue in political theology of enshrining the power of life and violence one over another into a legal system, be it in the form of a senator, minister, police officer, judge or king; there will still be the problem of the great negative forms of power. Masters of all institutions seek to be good masters; but first and foremost, <strong><em>they seek to be masters</em></strong>. There is an alliance among the aristocrats that they all believe there is good reason for them to be masters over the world, and to hold power over all.</p>
  <p>Sovereignty as we know it can only exist at the bequeathment from something or someone; or violently take from those same powers through revolution. Once entered into the subject of sovereignty, there is an immediate glaring flaw that a political body must offer sovereignty, or it must be taken by force. This force is what we seek to avoid in the first place, and what has locked humanity into a permanent struggle for power against and over itself–<em>homos lupus homnium</em>. For all of human history, this concept has battled between its two poles: one of accepting the sovereignty offered from another, or to fight that offering to take it for oneself. Violence and physical force are the tools used for the sovereign struggle to establish who is master, and who is slave.</p>
  <h3>Political History of Sovereignty</h3>
  <p>The most recent political revolutions of the late 16th century shifted the power by delegitimizing the divine right of kings, and enumerating that power into republican councils. Although there was resemblances of change within the structure of power, what really occurred was a shattering; a mutation of the system and a fracturing of power among many actors.  Sovereignty was stripped from kings, and that power was divided among the various ideological structures and repressive state apparatuses that make the modern state.</p>
  <p><a href="https://btctheory.files.wordpress.com/2014/10/screen-shot-2015-05-30-at-9-08-16-pm.png"><img class="alignright size-medium wp-image-2339" src="https://btctheory.files.wordpress.com/2014/10/screen-shot-2015-05-30-at-9-08-16-pm.png?w=220&amp;h=300" alt="Screen Shot 2015-05-30 at 9.08.16 PM" width="220" height="300" /></a>Power is no longer centralized within one body (The King), but is fractured into the government bureaucracy itself as a corporate body. Power, legality, legitimacy, sovereignty, the party as aristocracy, and state-sanctioned violence as a means to execute the law, are all part of this same political-government structure. However, these forces are no longer vested in the one body of the monarchy, but a new body of people outside the law itself. The decree of Divine Right that was once used to inflict the rule by Kings, is today being used to inflict the Rule of the State, but this time under the title of civil liberties.</p>
  <p>Invariable, man finds himself under the bludgeon, chain, and whip, happy to oblige, for he no longer has one master, but many! And this time they are for the good of civil liberties! He fails to recognize that the defenders of civil liberties seek to protect their own rights first and foremost at the expense of his flesh.</p>
  <p>Violence is the means that compliance with unjust laws are explicitly extorted upon the populous.  It is not the justice or majesty of contemporary legal systems that enforces the law; but ruthless, uncaring, violence. It is within the hidden manipulations of what is normal and appropriate that we also find apologists who demand to be ruled as a subjects, not people.</p>
  <p>If people are to liberate themselves from such an insidious and total system of rule, it must be upon their own merits to help themselves. People must arm themselves with knowledge, and a willingness to think critically to create a new, and better world. Using the internet, bitcoin, and strong crypto we can create a better world, and establish new laws from within the internet to help save us from global environmental catastrophe that is coming.</p>
  <h3>Cryptography and Self-Legitimacy</h3>
  <p>Digital currencies retreats from the theology of sovereignty via violence through creating a new mode of sovereignty. Intangible and non-physical, this new form of power is created through a <a href="https://btctheory.com/2016/07/27/the-destituent-power-of-crypto/">destituent form of power</a>, one that withdraws and refuses to cooperate with any form of violence.</p>
  <p>Legitimacy within cryptography is created from knowable and provably unbreakable secrets that can only exist the digital realm or mathematics. It cares not for what occurs in the physical world, but only that of which it can experience in the digital world: provable mathematics and the sacrament of the private key.</p>
  <p>Legitimacy no longer comes from an authority within the current political or economic system, but creates its legitimacy through <em>explicitly existing outside of any states control and the violence they enshrine. </em></p>
  <p>The concept of sovereign is flipped on its head. No longer does legitimacy need to come from state institutions that are empowered via violence, but through provable mathematical systems that are not part of the violence power structure. This creates a new economy system with No God, and No Masters.</p>
  <p>No longer do we need to pay for the privilege of our freedom to exchange with one another, or be extorted by the Gods of Government, or their Masters of Capitalism.  Bitcoin re-invents money into what it once was, and was always suppose to be–a network of legal and economic exchange for all people everywhere.</p>
  <p>—</p>
  <p>Next: <a href="https://btctheory.com/2014/11/04/the-legal-politics-of-money/" target="_blank">The Legal Politics of Money</a></p>
  <p><img class="aligncenter" src="https://i1.wp.com/www.political-humor.org/wp-content/uploads/2012/06/henry-david-thoreau.jpg" alt="" width="350" height="250" /></p>
  			</div><div class="entry-content">
  		<p>Over the last few years there have been a number of papers and blog post on <a href="http://iang.org/papers/BitcoinBreachesGreshamsLaw.pdf">Gresham’s law and bitcoin</a>. Most of these have rudely proclaimed that bitcoin will die because of <a href="http://en.wikipedia.org/wiki/Gresham's_law">Gresham’s law</a>–ironically, it will be fiat currencies that will die because of that law, not bitcoin. This is because the real value of fiat money is always going to be lower than the real utility value of bitcoin. As the<a title="The Magic of Money, The Science of Bitcoin" href="https://btctheory.com/2014/08/13/the-magic-of-money-the-science-of-bitcoin/" target="_blank"> illusion of fiat money is exposed for what it is</a>, the value of bitcoin compared to it will continue to go higher, and higher.</p>
  <h3>Gresham’s Law, Real and Nominal Values</h3>
  <p>Gresham’s law dictates that bad money will drive out the good due. This is due to the fact that ‘bad money’ is overvalued so you want to use it; while good money is undervalued, so you want to save it. Thus, consumers will get more bang for the buck using the inferior money, and will benefit from hoarding the superior money.</p>
  <p>Let me elaborate in an example using a $100 bill and a 1oz Gold Double Eagle $20 coin. In terms of the recognition of value, the $100 has a higher nominal value than the $20 coin. However, one would be an idiot to spend the $20 gold coin on $20 worth of goods, as the gold coin’s commodity value worth well over $1000. This is why we don’t see $20 gold coins floating around–people have ‘horde’ them up so those coins are no longer in the money supply.</p>
  <p>This is what is meant by the saying of Gresham’s law: bad money drives out the good. Please see difference my post The Legal Politics of Money for more details on the difference between nominal value (<i>valor impositus)</i> and real commodity value (<i>bonitas intrinseca).</i></p>
  <p>In contemporary society, we have a hard time understanding that ‘money’ is really just a catch-all term for ‘object of exchange value.’ Really anything can be money–gold, bushel of wheat, salt, <a title="Shelling out--the origins of money" href="http://szabo.best.vwh.net/shell.html" target="_blank">seashells</a>, etc.–what is important about money is that it is an equal and standard measure. Because governments have historically fix fiat money’s value to something (in the case of the 1oz gold coin, it was $20, as that was the rate that the FED honored from 1913 to 1933–1oz of gold was = $20) it creates two values: real and nominal.</p>
  <p>This means ALL money has two values–a real commodity value, and a nominal value. The commodity value is the worth of the object that the money is made of; such as the gold the coin is made from, or the paper that a dollar bill is printed on, or <a title="bitcoin as a commodity money" href="https://btctheory.com/2014/11/19/bitcoin-as-a-commodity-money/" target="_blank">the electrical energy that is spent on mining bitcoins</a>. This commodity value will always be independent of the nominal money value of money.</p>
  <p>Historically, governments always ‘pegged’ the nominal value of government money to the commodity value of gold or silver. Today however, because dollars are not pegged to anything and are free-floating, the value of dollars are decided by the market alone; just like bitcoin. Dollars today are only and explicitly nominal values–as the paper they are printed on is just that–paper that has no commodity value other than being legal tender. People can assess those two values (nominal vs. commodity) against one another and decide for themselves what is more advantageous. That which is seen as ‘bad money’ is spent, and the ‘good money’ is saved for a later date when its value has increased. The ‘demand’ for money is called <a href="https://btctheory.com/2013/09/08/bitcoin-and-liquidity-preference/" target="_blank">liquidity preference</a>, as the demand of each monetary unit and it total value is also affected by how liquid it is, and how willing people are to accept it.</p>
  <blockquote><p><img class="alignright" src="https://i1.wp.com/upload.wikimedia.org/wikipedia/commons/thumb/1/11/Specimen1Rev.jpg/128px-Specimen1Rev.jpg" alt="double eagle gold coin" width="128" height="128" />In short:</p>
  <p>$20 double eagle gold coin; nominal value = $20</p>
  <p>$100 bill; nominal value = $100</p>
  <p>These are the values that these monies have because of the nominal, set values by the government.</p>
  <p>$20 double eagle gold coin; real commodity value = around $1200 because of the 1oz of gold it contains</p>
  <p>$100 bill; real commodity value = <a title="New $100 bill costs 60% more to produce--Marketwatch" href="http://www.marketwatch.com/story/new-100-bill-costs-60-more-to-produce-2013-10-08" target="_blank">Around $0.13 per bill</a> to produced because it is just fancy cotton.</p></blockquote>
  <p>Money has two independent values : the nominal value, or the set price that the government will value that money at; and the real commodity value–the price that money has because of its own <a href="https://btctheory.com/2013/09/10/what-is-bitcoins-intrinsic-value/" target="_blank">intrinsic commodity value</a>. This is why <a title="junk silver" href="http://en.wikipedia.org/wiki/Junk_silver" target="_blank">dimes made before 1964 have vanish from the supply</a>–as the silver they are made out of is worth at least $1, thus it becomes a better option to spend zinc dimes (post-1964) that are worthless than $0.10 per coin, vs. spending dimes that are worth more than $0.10.</p>
  <h3>The Value of Fiat Money</h3>
  <p><img class="wp-image-2125 aligncenter" src="https://btctheory.files.wordpress.com/2014/08/peso-to-dollar.png?w=467&amp;h=344" alt="peso-to-dollar" width="467" height="344" />Fiat money by definition has no intrinsic value. The only the value that fiat money has is the threat of legal force if someone refuses it. This is why the value of fiat money is directly tied to the legitimacy of the governments that issue those currencies. Right now, we are seeing a <a title="Argentina's peso First decline, now fall" href="http://www.economist.com/blogs/americasview/2014/01/argentinas-peso" target="_blank">collapse of the Argentina peso</a> (again), which is due to the government’s refusal to pay it debts. This in turn has lead to a crisis in confidence of the monetary stability of the peso, which has caused for a self-fulfilling prophecy of people and investors fleeing the peso.</p>
  <p>As people dump the peso for other options (mostly dollars due to <a href="http://www.mckinsey.com/insights/economic_studies/an_exorbitant_privilege" target="_blank">exorbitant privilege</a>), the value of the peso goes into free fall because there is far too much supply and not enough demand. This causes for the value of the peso to plummet, and people want to get rid of their peso as fast as possible for something that can hold value. This can be commodities, cars, property, foreign currency, or anything that can help them store value and not quickly evaporate under the <a href="http://spectator.org/articles/60183/argentina-where-default-not-default" target="_blank">56% inflation they are currently facing</a>.  As this process builds, one of two things happens:</p>
  <p>1. The value of the peso collapse far enough for supply and demand to meet, and the value will start to stabilize, abated after losing a signification amount of it’s value.</p>
  <p>2. The peso is continually dumped, the value will go into almost total free fall, and hyperinflation will ensue.</p>
  <p>It is important to understand that <a title="Hyperinflation" href="http://en.wikipedia.org/wiki/Hyperinflation" target="_blank">hyperinflation</a> is linked to a dramatic rise in the velocity of money, as people are trying to transact with that money almost immediately, as people want to get what their money is worth, and not lose 50% of their purchasing power. Furthermore, this problem then tends to be exacerbated by government printing more money to try to deal with price increases, which further expands the money supply of a market that is already oversupplied with a money no one wants.  For more details on how hyperinflation and velocity of money operate together, please see <a href="http://www.sjsu.edu/faculty/watkins/infldynamic.htm" target="_blank">this page</a>.</p>
  <h3>Working Towards the True Value of Bitcoin</h3>
  <p>When we look at bitcoin from the lens of Gresham’s Law it is rather impossible to determine if bitcoin is overvalued or undervalued; as by definition, whatever the market price is today is the real value. Due to bitcoin’s total elasticity, the value of bitcoin can theoretically fluctuate from millions of dollars in a matter of minutes, with little changing in the market other than perception. If we look closely, there are several indicators which we can use to see if bitcoin is undervalued or overvalued. Some of these indicators are the transaction volume, the cost of bitcoin mining, the number of market participants, and the bitcoin day’s destroyed metric.</p>
  <p>The transaction volume can act as an indicator of the equilibrium of the bitcoin market. We can assume that generally if the value of bitcoin is overvalued, more people will spend their bitcoin than fiat; wheras if bitcoin is undervalued, people would rather spend fiat than bitcoin. However, both miners, and bitcoin based business both need to sell bitcoin for fiat to pay their bills–which in the case of the price dropping precipitously, these buisness would need to dump even more bitcoin, which would accelerate the drop in price. This can lead to <a href="http://seekingalpha.com/article/126165-george-soros-reflexivity-and-market-reversals" target="_blank">dynamic disequilibrium</a>, which is essentially when the market has lost its collective mind, and the euphoria or panic of the digital herd dictates the market and creates a self-fulfilling prophecy that is totally unrelated to the <a title="bitcoin as commodity money" href="https://btctheory.com/2014/11/19/bitcoin-as-a-commodity-money/" target="_blank">commodity value of bitcoin</a>. What can be seen in any situation of disequilibrium is the velocity of bitcoin is much higher than the norm.</p>
  <h3>Velocity Adjustment of Bitcoin</h3>
  <p>If bitcoin is undervalued, than transaction volume will continue to drop, tightening the money supply until equilibrium price has been met. If bitcoin is overvalued, then the supply cannot meet the demand, and the price will rise until equilibrium is met.</p>
  <p>The value of bitcoin pulled between the social value of the network at the current time (short-term), verses the total electrical expenditure that has been spent to create the bitcoin supply today (long-term). This creates a moving target for what the ‘true value’ of bitcoin is. The higher the velocity compared to the historic gross average velocity of bitcoin, the greater the chance of bitcoin’s price being in disequilibrium. The lower the velocity compared to the historic norm, greater the equilibrium there is.</p>
  <p>The fixed supply of bitcoin ensures that the <em>only way</em> to adjust the monetary value of bitcoin is through exchange. When the price is undervalued or overvalued, the transaction ratio compared to the norm will be much greater.</p>
  <h3>Conclusion</h3>
  <p>When comparing digital currencies and fiat currencies directly against one another, it is quite clear that digital currencies are very undervalued at this time. There is a clear limit on the number of bitcoins that can be forged, they are backed by the real electrical energy that is expended on bitcoin mining, and there is a huge amounts of VC capital going into building the bitcoin ecosystem. This is no different from the expenditures that go into mining operations for gold, silver, platinum, or fossil fuels. Furthermore, bitcoin and other digital currencies are digital natives, living in the realm of the internet; which is the largest and fastest growing economy in the world. Goverments and their fiat money will always be interlopers in the transglobal internet. Chained to the states they are from, with the slow, inefficent, and backwards idea that state-based fiat money work will in a transglobal economy, they will succumb to <a href="https://btctheory.com/2014/12/04/creative-destruction-of-bitcoin/" target="_blank">the creative destruction of bitcoin</a>. When looking back on 2015 from the vantage point of 2025, it will seem laughable that digital currencies didn’t immediately usurp fiat money. We simply need to look to <a href="http://dailyreckoning.com/fiat-currency/">the history of the failure of fiat currencies</a> to understand that it is not a question of if they will fail, but when.</p>
  <p>The issues of the financial crisis of 2008 were never addressed, which has made the entire financial economy today into one huge moral hazard. This empire of paper will topple soon, and it is refreshing to know that in that process, we will be able to take back our financial power, and <a href="https://btctheory.com/2014/05/16/capital-exit-capital-strike/" target="_blank">strike at the very heart of state-capitalism</a>.</p>
  <p>—</p>
  <p>Next: <a href="https://btctheory.com/2013/10/21/transaction-cost-bitcoin/" target="_blank">The Transaction Cost of Bitcoin</a></p>
  			</div><div class="entry-content">
  		<p><img class="alignleft" src="https://i0.wp.com/cdn.theatlantic.com/newsroom/img/posts/BitcoinDollars.jpg.jpg" alt="" width="360" height="221" />To understand Bitcoin, we need to also understand the history of money. This is a long and complex topic that has changed dramatically over the last 400 years, and has a total history of more than 3000 years. In order to understand both money, and bitcoin, we need to understand that there are two distinct functions that money has, that are independent of each other, but both influences money’s value: the payment function of money, and its storage of value function.</p>
  <p>Both of these features have important functions for money, but it is important to understand how each one of these affect money differently. I cover this in more detail in <a href="https://btctheory.com/2013/09/10/what-is-bitcoins-intrinsic-value/">what is the intrinsic value of bitcoin</a>, and <a href="https://btctheory.com/2014/11/19/bitcoin-as-a-commodity-money/" target="_blank">bitcoin as commodity money</a>.</p>
  <p>The best way to think of it is that bitcoin is a threat to both common storage of value; such as precious metals like gold and silver, but it is also a threat to normal fiat money because of the bitcoin payment network. These two features of bitcoin create one type of money that is superior to both precious metals and fiat currencies. To understand why bitcoin works as money, we need to understand the history of money over the last century.</p>
  <h3><strong>The History of Banking</strong></h3>
  <p>To understand banking, we need to know what is a mode of exchange, how did it come about, and why it was needed in addition to a storage of value.</p>
  <p>A mode of exchange is just that, a mode in which you can engage in the exchange of one good for another. Before modern money, this could be anything that was commonly exchanged, and the value was well understood by the general public. Throughout history, this has been everything including bushels of wheat, tobacco, land, etc. As long as both parties understood the value of what was being exchanged and chose to accept it, it could function as a mode of exchange.</p>
  <p>As gold became the common standard for exchange during the <a href="http://en.wikipedia.org/wiki/Mercantilism" target="_blank">mercantilism era</a>, there became substantial risk in carrying large amounts of precious metals. Instead of carrying around a brick of gold, people could carry around notes that were redeemable at banks for the same amount of gold as the note. This is how banking has been practiced for most of its existence. It has only been in the last century that fiat paper money with no convertibility to a commodity has become the norm.</p>
  <p>It is substantially important to understand that fiat money came about to <em>represent</em> an actual storage of value to make <em>real payments</em>. The only reason fiat money ever did come about is because it was a technological innovation that was fiat money. To be able to spend the value of gold, but carry it around in a lighter paper form what a huge technological development that fundamentally changed how exchange was preformed. This allowed for people to continue commerce in the same ways as before, but now with their wealth from the threat of theft.</p>
  <p>Ironically, the creation of banking notes that can be redeemed for a storage of value also created the needed framework for the current system of <a href="http://en.wikipedia.org/wiki/Fractional_reserve_banking" target="_blank">fractional reserve banking</a> that all states use today. This created a kind of banking system where banks no longer operated on how much money they have available, but they operate on only a fraction of the total they should have available. Banks use this system to cheat their profits by using the multiplier effect to multiply their profits–and their losses. These losses can become so substantial that it can destroy the entire banking system and economy. This is what happened during the Great Depression, and more recently during the 2008 meltdown.</p>
  <h3><strong>The Bretton Woods Era</strong></h3>
  <p><img class="alignright" src="https://i0.wp.com/criticalfinancial.com/wp-content/uploads/bretton-woods-sign.jpg" alt="" width="480" height="338" />near the end of WWII, the allies came together in secret meeting in Bretton Woods to negotiate how the new global economy would be built. Keynes wanted an <a href="http://www.monbiot.com/2008/11/18/clearing-up-this-mess/" target="_blank">International Clearing Union </a>which would use a fair international banking currency based off of trade deficits called the Bancor. This became the official position of the UK when negotiating at the BW conference.</p>
  <p>Keynes’ idea was rejected (despite its popularity), and instead the dollar was to replace the international currency unit, which today gives the U.S. a special power in international finance call <a href="https://en.wikipedia.org/wiki/Exorbitant_privilege" target="_blank">exorbitant privilege</a>. To do this, $35 was set as the redeemable price for one ounce of gold (almost twice what it was worth when it was <a href="http://en.wikipedia.org/wiki/Executive_Order_6102" target="_blank">seized from U.S. Citizens back in 1933</a>), and what would become the IMF was setup. Keynes understood the huge issues this would create in international monetary system, and <a href="http://digamo.free.fr/keynes46.pdf" target="_blank">offered incredible insight</a> to how this would play out 20 years later.</p>
  <p>This system would have worked, if the U.S. was not cheating on their balance of payments. From 1945 to 1971 more and more U.S. dollars started circulating around the globe because the U.S. was importing more than they were exporting–creating a negative balance of payments. In fact, so many dollars were exported like this that the U.S. could not cover all of the outstanding gold that the dollars represented. The French were suspicious of this in the 1960s and started to <a href="http://www.gold-eagle.com/article/lessons-london-gold-pool" target="_blank">repatriate their gold</a>, which led to <a href="http://www.businessweek.com/magazine/the-nixon-shock-08042011.html" target="_blank">Nixon shock</a>. In 1969, Nixon announced that the dollar was no longer convertible to gold, and created a 10%  tariff to protect american industries from the shock of this. $35 was no longer worth an ounce of gold–it was worth nothing.</p>
  <h3><strong>Nixon Shock</strong></h3>
  <p>In order to make sure that the dollar did not enter into a death spiral of hyperinflation, Nixon as put in place tariffs, wage freezes, and a fixed exchange rate until he figured out what to do to give the dollar value. In 1973, Henry Kissinger struck a deal with the Saudi King. In exchange for arming and supporting the Saudis and their brutality domestically, they would agree to sell oil in <strong>only</strong> U.S. Dollars. This created the ‘<a href="https://en.wikipedia.org/wiki/Petrodollar" target="_blank">petrodollar</a>‘ which propped up the value of the dollar now that it was no longer exchangeable. So from 1973 on, the dollar was no longer worth gold, but oil.</p>
  <p><strong><img class="aligncenter" src="https://i1.wp.com/i.imgur.com/2o6rxwj.jpg" alt="" width="571" height="456" /></strong></p>
  <p>Nearly thirty years later we can see the evidence of how decoupling the dollar from gold has shattered faith in the global monetary system and the dollar. This had huge consequences for the purchasing power of the dollar and everyone who used it. Below is a chart of the purchasing power of the dollar since 1970–today the dollar of 1970 can only purchase $0.18 of goods today–it lost more than 4/5th of its purchasing power in just 45 years.</p>
  <p><img class="aligncenter" title="Credit: Rightwaycharts.com" src="https://i2.wp.com/goldnews.bullionvault.com/files/06222011_Dollar_Purchasing_Power.png" alt="" width="470" height="280" /></p>

  <h3><strong>The Theft of The World</strong></h3>
  <p>Now that money was no longer tied to the actual value of commodities and is free-floating, it became possible for the theft of the productive capacity of not just entire nations, but the world itself through the monopolization of money by state governments. Slowly over decades, inflation simply caused for the slipping purchasing power of not only the dollar, but all fiat currencies. This was done so slowly and deliberately that few could understand what Keynes had warned people of so many years before:</p>
  <blockquote><p><img class="alignleft" src="https://btctheory.files.wordpress.com/2014/06/7a52f-keynesinhat.jpg?w=242&amp;h=247" alt="" width="242" height="247" />“Lenin is said to have declared that the best way to destroy the capitalist system was to debauch the currency. By a continuing process of inflation, governments can confiscate, secretly and unobserved, an important part of the wealth of their citizens. By this method they not only confiscate, but they confiscate arbitrarily; and, while the process impoverishes many, it actually enriches some. The sight of this arbitrary rearrangement of riches strikes not only at security, but at confidence in the equity of the existing distribution of wealth. Those to whom the system brings windfalls, beyond their deserts and even beyond their expectations or desires, become ‘profiteers,’ who are the object of the hatred of the bourgeoisie, whom the inflationism has impoverished, not less than of the proletariat. As the inflation proceeds and the real value of the currency fluctuates wildly from month to month, all permanent relations between debtors and creditors, which form the ultimate foundation of capitalism, become so utterly disordered as to be almost meaningless; and the process of wealth-getting degenerates into a gamble and a lottery. Lenin was certainly right. There is no subtler, no surer means of overturning the existing basis of society than to debauch the currency. The process engages all the hidden forces of economic law on the side of destruction, and does it in a manner which not one man in a million is able to diagnose.”</p>
  <p>–JMK, <a href="http://www.fordham.edu/halsall/mod/1920keynes.html" target="_blank">The Economic Consequences of the Peace</a> (1919)</p></blockquote>
  <p>Today the inflation that we face is not due to new gold being introduced to the fractional-reserve banking system, but from the value of the dollar simply decreasing.  Today there are <a href="http://www.forbes.com/sites/johntamny/2014/03/09/the-fed-is-not-printing-money-its-doing-something-much-worse/" target="_blank">more dollars in the world today than yesterday</a> due to quantitative easing (i.e. making more dollars). The decrease in the purchasing power of the dollar is a direct loss to you and everyone using the dollar; and a direct gain for the government and banks who benefit from the creation of new dollars. We have been told that these are good men, and that they will use monetary policy to create price stability and keeping unemployment low, but the facts show something much different and much more insidious. </p>
  <h3><strong>Failure of Gold as a Storage of Wealth</strong></h3>
  <p>Gold has been used as a storage of wealth for millennia because of the total fungible nature of gold. However, what happened from the start of the 20th century, to the end of WWII, was a consolidation of gold in the hands of the State through legal confiscation and violence. By 1973, almost all gold was in the hands of the state through force and theft.</p>
  <p>This was done in two distinct ways. There was state-to-state confiscation of gold and precious metals, such as the reparations from WWI and imperialism. This concentrated gold in the global north in the hands of a small number of elite bankers and business magnates. The other way was through the war that governments carried out against the private wealth of their own citizens.</p>
  <p>This can be seen throughout the world with the restrictive legislation from states around the globe; such as<a href="http://en.wikipedia.org/wiki/Executive_Order_6102" target="_blank"> Executive Order 6102</a>, <a href="http://www.returnaussiegold.net.au/#!gold-confiscation/c667" target="_blank">The Australian </a><i><a href="http://www.returnaussiegold.net.au/#!gold-confiscation/c667" target="_blank">Banking Act 1959</a>, </i>and the <a href="http://blogs.wsj.com/indiarealtime/2013/01/24/the-return-of-the-gold-smuggler/" target="_blank">Indian </a><em><a href="http://blogs.wsj.com/indiarealtime/2013/01/24/the-return-of-the-gold-smuggler/" target="_blank">Gold (Control) Act 1968</a>. </em>Instead of protecting citizens from the tyranny of wealth seizures, holding gold actually made people a target for the state. Through this violent seizure of wealth, governments essentially gained an oligopoly on gold. This allowed for <a href="http://www.silverdoctors.com/chinese-central-banks-fingerprints-are-all-over-the-gold-manipulation/http://www.silverdoctors.com/chinese-central-banks-fingerprints-are-all-over-the-gold-manipulation/" target="_blank">governments</a> and their <a href="http://www.zerohedge.com/news/2014-05-23/barclays-fined-manipulating-price-gold-decade-sending-bursts-sell-orders" target="_blank">allies in banking</a> to manipulate the price of gold through holding or dumping; but more importunately, they have rendered gold meaningless as a source of payment and storage of value. Today, almost no one will take your gold or silver as payment, despite the fact it truly is worth more than paper money.</p>
  <h3><strong>The Need for Protection From The State<img class="alignright" src="https://btctheory.files.wordpress.com/2014/06/83882-governmentthebrilliantideathatweshouldstoplunaticsfromlyingmurderingstealingfromusbyhiringlunaticstoliemurderstealfromus.jpg?w=371&amp;h=316" alt="" width="371" height="316" /></strong></h3>
  <p>It should be obvious that the greatest threat to ones personal wealth is not some foreign or personal aggressor, but the State itself. This puts us in a predicament because the State is the owner of the means of exchange, and the arbitrator of all legality. Through controlling the means of exchange, the State can manipulate the value of the dollar on a large scale for its own benefit (such as quantitative easing or unlimited funding for war), while also being the gatekeeper of the finance system. The greatest issue with this is that even if you find a suitable alternative means of exchange (like bitcoin), the state can still call it illegal, and bring violence to you and your family for not complying.</p>
  <p>If one is to control a large portion of wealth, it can only be done with the explicit approval of the State. At any time they can choose to seized you wealth, and you can go to prison. The accumulation of large amounts of wealth becomes impossible without the approval of the State in modern society. If the State does not approve of it, they will call it ‘money laundering’ and treat you as a criminal. This means that it is impossible for someone to be against the state, while still being able to control their wealth. This helps explain why the state is so active in financial oppression against its own citizens, while allowing for out right <a href="http://www.forbes.com/sites/timworstall/2013/08/08/hsbcs-1-9-billion-money-laundering-fine-and-the-somalian-cost-of-bank-regulation/" target="_blank">crimes to be preformed by some of the largest banks in the world</a>, and <a href="http://www.theguardian.com/us-news/video/2014/dec/04/i-cant-breathe-eric-garner-chokehold-death-video" target="_blank">letting police execute its citizens</a>.</p>
  <p>This explicitly displays that the State has the power to stop these criminals today,  and yet they choose not to do so. This is because the government is in bed with these organizations. Politicians receive ‘<a href="https://www.opensecrets.org/lobby/clientsum.php?id=D000021791&amp;year=2011" target="_blank">donations</a>‘ from these companies and <a href="http://www.washingtonpost.com/opinions/katrina-vanden-heuvel-fed-up-with-wall-streets-revolving-door/2013/07/30/7f171f02-f893-11e2-8e84-c56731a202fb_story.html" target="_blank">former CEOs are given elite, secure jobs from the government</a> later down the line in exchange for this. These companies have bought laws and protection for themselves at the direct expense of other citizens through the corruption of the legal, and political system. It should be clear and obvious for all to see: we cannot recover this system of government, economics, and finance, and we must reject the system as a whole.</p>
  <p>Now that we have bitcoin, we can actual do that. Once we reject the money of the State, and their crony capitalist bankers, the value of their fiat money will collapse. The State will no longer be able to pay for their wars, bloated salaries, or mechanisms of fear and terrorism. There will be a great unwinding and no one will accept their shitty paper money anymore.</p>
  <h3><strong>Conclusion</strong></h3>
  <p><a href="https://btctheory.files.wordpress.com/2014/06/bit-free.png"><img class="alignleft size-medium wp-image-1175" src="https://btctheory.files.wordpress.com/2014/06/bit-free.png?w=231&amp;h=300" alt="bit-free" width="231" height="300" /></a>The State over the course of the last hundred years has pulled off one of the greatest stunts ever: getting people to believe that paper is worth more than real commodities. Through the slow theft of gold for paper, people have been robbed of their ability to have independent wealth. Wealth today can only be acquired at the good will of the State because the State monopolizes the legal authority for how you can get money. The State, and their banker allies siphon off as much value as they can from the productive capacity of normal, hard-working people through devaluing fiat money through quantitative easing and interest.</p>
  <p>From the end of gold standard in 1933, to all of the usurpation that brought us to where we are today, it should be clear that <strong>governments cannot be trusted with our wealth</strong>. Bitcoin and digital currencies offers people a chance to have a financial system that does not empower the State, or elite banks, but protection us from them.</p>
  <p>Bitcoin is a global payment system, and storage of wealth that allows for a new system of finance and economics to be built. One based upon the principals of mathematics, privacy, and provability. A new system where we are not punished for saving and protecting our wealth, but rewarded. A system that understands, respects, and protects people’s right to privacy, and their right to conduct commerce with anyone in the world, no matter what State has their bootheel on their back, demanding a portion of their wealth.</p>
  <p>Change is coming, and it will be radical, and it will change the world for the better.</p>
  <p>—</p>
  <p>Next: <a href="https://btctheory.com/2014/10/09/the-absolute-value-of-crypto/" target="_blank">The Absolute Value of  Crypto</a></p>
  			</div>


