XD blog

blog page

2015-04


2015-04-27 IoT, Internet of things and Python

Internet of Things is a way to say that every object can be connected to each others and to you. We will be soon able to command many daily objects (fridge, table, bed, ...) from anywhere with a smartphone. They will be even able to take simple decisions for you such as ordering food which is missing from your fridge or started to warm your flat just because your smartphone is heading to your home. And it will be doable in Python: The WiPy: The Internet of Things Taken to the Next Level.

2015-04-24 Use javascript tools in your notebook

This is a reason why I do like notebooks. It is more than a static page. Many tools in javascript can be added to the page. The first example is about visualizing the differences between two files. I looks like that:

It is available with pyensae, more details here at A magic command to visualize differences between two files in a notebook.

The second example is about using Scratch from a notebook with Snap!. The code may be slow but the result is quite nice: Scratch dans un notebook.

2015-04-23 Open data and bias

The article 3 Cities Using Open Data in Creative Ways to Solve Problems shows three different ways to play with data and to build interesting information at a city level. Based on that, it becomes easier to improve the life of people leaving in that city. If this data is available to people taking decisions, they can take action to fix some the issues reported on the maps and they can measure the impact after it is fixed. However, if everybody knows this data, they would probably start to change their behaviour and the data will start reflecting that change. The first issue could artificially disappear without being fixed.

That's what explains the second article Randomized experimentation. By learning from the data, machine learned models end up proposing better options to people and they both forget others options are still possible.

2015-04-18 A few modules for Sphinx

Here are a few modules I will probably use when I need them to generate documentation with Sphinx. This is just to avoid searching for them again.

And some others modules to easily build graphs with javascript and python:

2015-04-11 PyPy.js, Python command line inside a WebPage

The conderence PyCon 2015 is just happening. You can find Ryan Kelly who implemented PyPy.js which is an implementation of the Python interpretor in javascript. That way, it is possible to add a python command line windows in a webpage, access the page elements by using python syntax... The following video gives some insights Ryan Kelly: PyPy.js: What? How? Why? about what it can do. And if you prefer something written: PyPy.js: Now faster than CPython .

2015-04-08 Easy website with Javascript

Many websites are based on a similar template today: one long page with many sections to scroll down. You will find example in this article: 42 top examples of JavaScript. It seems a long way to get something similar on your own. But with some web searches, it seems reasonable to find some javascript tools which can speed up the creating of the webiste. See The top 5 JavaScript templating engines for a blog, 10 Moteurs de templates pour Javascript et Nodejs, 25 free, scrolling plugins for awesome experiences. The code for the basic example seems quite short.

2015-04-07 Text and machine learning

How can we automatically translate text into another language? You can find some intuitive explanations of how that works from the video by Peter Norvig included in the blog post Being good at programming competitions correlates negatively with being good on the job. It introduces to machine learning, bag of words, Statistical Machine Translation. The conference is quite easy to follow and gives insight on how much data these system require.

2015-04-06 Blog generator

I publish my teaching material as python module. I added some tricks to made that happen. Recently, I was wondering how to add some kind of blog posts inside the documentation. As I have several teaching going on, I did not want to merge all blog posts into a single one where students would have to filter out what blog post is meant for them. So I thought about using a kind of blog generator written in Python on the top of Sphinx. I went through that blog post What's the best available static blog/website generator in Python? which gives a short list of them. It is possible to check their popularity by looking at Top Open-Source Static Site Generators.

I wanted to follow the same design for my blog, same pattern. So I was looking for a tool generated RST files and not directly HTML. Tinkerer seemed a good choice. Should I have to add the message powered by Tinkerer as every site using it is displaying that sentance? I also looked into Pelican, nykola. I also found a very simple one with a French name: éClaircie.

I finally decided to write some code to process my own blog posts and to insert them in the documentation of a an existing python module. It is not finalized yet but it looks like that: An example of a blog post included in the documentation. This process forces me to dig into sphinx devext API which I do not fully understand yet. It is quite difficult to find good examples on the web. What I have implemented is available here: pyquickhelper.helpgen.

By implementing my own blog, I cannot have all the features the static generators have (good templating, many languages). I spent most of my time in implementing the blog post aggregations (categories, months) and the splitting (not more than 10 blog posts per pages). But now, if I want to customize Sphinx a little bit, it is easier.


Xavier Dupré