XD blog

blog page

~technical


2014-11-14 Documentation for the module Azure in Python

I did find any documentation for the module azure-sdk-for-python so I generated it with Sphinx: azure-sdk-for-python (documentation).

2014-11-13 1981 : apprendre la programmation à l'école ?

En farfouillant sur Internet, je suis tombé sur un texte de Andreï Erschov : La programmation est un deuxième alphabétisme. C'est un exposé de 1981 sur l'utilisation des ordinateurs dans l'enseignement. C'est en Russe mais j'ai copié collé une traduction française faite par un moteur de traduction automatique et un peu retravaillée avec la traduction anglaise de meilleure qualité. J'espère que je n'ai pas déformé les propos de l'auteur, ce que je suis incapable de vérifier. Le texte a plus de trente ans mais il exprime déjà l'intuition que l'ordinateur et plus particulièrement la programmation vont considérablement changer la société, presque autant que l'écriture. Il est important que cette dernière fasse partie de l'enseignement afin de mieux préparer les enfants.


more...

2014-11-12 Notebook sur iPad

Après avoir installé un serveur de notebook sur une machine distante (voir Remote Notebook with Azure), j'ai voulu essayer depuis un iPad. Cela ne fonctionne pas à cause d'une erreur de WebSocket. Ca ne marche pas mieux avec Chrome (la solution proposée dans cette page ne marche pas). Il exite néanmoins l'application Computable pour iPad. Elle est gratuite pour essayer et payant pour créer ses propres notebooks. Elle utilise Python 2.7.

2014-11-11 SQLite in a Notebook with Magic Commands

Whenever I need to use SQLite, most of the time, I don't use Python because I don't do it often enough to remember the syntax. I usually use SQLiteSpy. However, converting any result to a dataframe is impossible unless I copy paste the results somewhere. So I implemented some magic commands in pyensae you can see in the notebook SQL Magic Commands with SQLite in a Notebook.

2014-11-10 Un article sur les valeurs extrêmes dans des réseaux sociaux

Predictability of Extreme Events in Social Media

2014-11-09 Remote Notebook with Azure

For my teachings, I installed a notebook server on a virtual machine on Azure. All the students will be able to connect the same login (the multi-user configuration is part of the roadmap). The students will not have to install the notebooks by themselves. They will be able to see what other students users do. Here are the steps I followed.

Step 1: create the virtual machine with Azure

I won't detail that, it is pretty straight forward. Just follow the tutorial Create a Virtual Machine Running Windows. I chose a Windows Server. The number of cores must depend on the number of users. I assume all students are not going to access the notebook at the same time except during the lectures. I chose eight cores. I might modify this post in case it is not enough.

Step 2: install Python (latest version - 3.4 today)


more...

2014-10-30 Issue with some Sphinx themes and Internet Explorer

The theme Bootstrap does not work well on Internet Explorer. In that case, the file [python_path]/Lib/site-packages/sphinx/themes/basic/layout.html must be modified to include the following line:

<meta http-equiv="X-UA-Compatible" content="IE=edge" />

2014-10-29 p5.js

It is a javascript framework to build presentation or interactive lectures: p5.js. Quite promising.

2014-10-25 agt-get on Windows = chocolatey

Installing a package is quite convenient on Linux : there is only one way. On Windows, you usually go to each software website and download the setup from there. But there exists another option now: chocolatey. Once it is installed, you can install a software just like that:

choco install notepadplusplus

2014-10-24 Programmation Artistique

Je viens de passer la semaine à essayer de comprendre comment faire des choses simplement avec des outils compliqués. C'est comme si je m'étais cassé la tête à essayer de comprendre le manuel de mon réfrigérateur dont je ne sais toujours pas régler la température, le réglage de ma chaîne hifi ou le bouton camouflé qui ouvre mon aspirateur. Il est si discret que j'oublie à chaque fois que ce n'est pas un auto-collant. On perd un temps fou à essayer de comprendre cette forme de raisonnement intuitif qu'un autre a imaginé pour vous. Et comme cet intuitif m'échappe complètement ce soir, j'aimerais me dire que mon frigo fonctionne comme ce livre : Raisonnements divins et que le temps que je passe à essayer de le comprendre n'est pas passé en vain. Heureusement qu'il garde les bières au frais, sinon, je crois que je deviendrais fou.

2014-10-23 Fix table of contents in a Notebook

When I have a long notebook, I find it difficult to navigate through it. Maybe I should not do that. However, some outputs are quite long sometimes and the page gets longer. I usually put a table of contents at the beginning but it means I need to go back to the top of the page anytime I want to go to a specific section. That's why I tried a table of contents in a section div with an absolute position (the notebook is here). It works nice even if the mix between markdown and HTML gives weird results sometimes. The only drawback is the conversion of the notebook into HTML or rst. The table of contents shows up at the top of the page at the expected place but disappears after the page was scrolled down.

2014-10-21 Pycrypto on Windows

I was looking for a way to build pycrypto on Windows. So I started to download Visual Studio Express 2010. But it requires to get MPIR and GMP. I gave up. Unfortunately, many versions are available at The Voidspace Python Modules, but nothing for Python 3.4. Fortunately, the rest can be found in a link mentioned at pycrypto 3.4 binaries for windows x86.

2014-10-17 Python Just In Time Compilation (JIT)

I discovered a new package to do just in time compilation for Python: HOPE. The following paper gives a promising benchmark compare to others alternatives: HOPE: A Python Just-In-Time compiler for astrophysical computations. It was not tested on Windows.

2014-10-16 Coding in a train without internet

I'm in a train unable to access internet and I thought I could do something without it. But what I do is not an algorithm, it is a simple functionality which requires a function I use from time to time. It is Python, so I type help (function). I understand what it says but I'm unable to guess what value I need and there is no example. I know I could easily get that by using a search engine python function example. But I can't so I prefer to give up just because I know I could spend a lot of time guessing this particular value I don't know. I don't know how to program without internet anymore.

2014-10-11 Machine learning et algorithme

Il existe plein d'outils pour manipuler les données, pandas, R, Excel, ... Ces outils font la plupart des choses pour nous et pourtant parfois, on a besoin de calculer un indicateur imprévu. C'est la cas du drawdown qui est un indicateur financier qu'on calcule parfois sur la performance d'un produit financier. Naïvement, on implémente une solution qui n'est pas toujours optimale et pourtant son calcul est identique à celui de la sous-séquence de plus grande somme qui est un algorithme classique.


<-- -->

Xavier Dupré